You are here

function update_modal_page_views in Modal 8.2

Same name and namespace in other branches
  1. 8.3 modal_page.install \update_modal_page_views()
  2. 5.0.x modal_page.install \update_modal_page_views()
  3. 4.0.x modal_page.install \update_modal_page_views()
  4. 4.1.x modal_page.install \update_modal_page_views()

Update views settings.

3 calls to update_modal_page_views()
modal_page_update_8201 in ./modal_page.install
Implements hook_update_N().
modal_page_update_8203 in ./modal_page.install
Implements hook_update_N().
modal_page_update_8206 in ./modal_page.install
Update on Modal Views to be more organized.

File

./modal_page.install, line 215
Install, update and uninstall functions for the Modal Page.

Code

function update_modal_page_views() {
  if (empty(\Drupal::moduleHandler()
    ->moduleExists('views'))) {
    return FALSE;
  }
  $config_views_path = drupal_get_path('module', 'modal_page') . '/config/optional/views.view.list_modal.yml';
  $data = Yaml::decode(file_get_contents($config_views_path));
  \Drupal::configFactory()
    ->getEditable('views.view.list_modal')
    ->setData($data)
    ->save(TRUE);
  \Drupal::service('cache.render')
    ->invalidateAll();
}