Blog Archive

Thursday, 4 February 2016

Drupal 8 how to delete the View Config entity while uninstalling the module?

Please  see the link https://www.drupal.org/node/2565543

Or in the hook_uninstall() using the following code

// Deleting the views while uninstalling.

\Drupal::configFactory()->getEditable('views.view.scheduled_content')->delete();

OR you can use the following code,

 $entityView = \Drupal::entityTypeManager()->getStorage('view')->load('test_view_to_delete'); $entityView->delete();

No comments:

Post a Comment