Created
April 11, 2017 06:17
-
-
Save nikunjkotecha/8421584850d5878b43657902fb321873 to your computer and use it in GitHub Desktop.
Drupal 8 - using update hook to revert view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Contains install, update, uninstall hooks for mymodule module. | |
*/ | |
/** | |
* Implements hook_update_N(). | |
* | |
* Revert views config - assuming the config name is views.view.product_category_level_3.yml. | |
*/ | |
function mymodule_update_8000() { | |
$reverter = \Drupal::service('config_update.config_update'); | |
$reverter->revert('view', 'product_category_level_3'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment