You are here

function commerce_wishlist_update_8308 in Commerce Wishlist 8.3

Delete config that is no longer used.

File

./commerce_wishlist.install, line 197
Contains install and update functions for Commerce Wishlist.

Code

function commerce_wishlist_update_8308() {

  /** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */
  $config_factory = \Drupal::service('config.factory');
  $config = [
    'core.entity_view_display.commerce_wishlist.default.user',
    'core.entity_view_mode.commerce_wishlist.user',
    'views.view.commerce_wishlist_form',
    'views.view.commerce_user_wishlists',
  ];
  foreach ($config as $config_name) {
    $config_factory
      ->getEditable($config_name)
      ->delete();
  }
}