Mercurial > hg > isophonics-drupal-site
diff core/modules/dblog/dblog.install @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
line wrap: on
line diff
--- a/core/modules/dblog/dblog.install Tue Jul 10 15:07:59 2018 +0100 +++ b/core/modules/dblog/dblog.install Thu Feb 28 13:21:36 2019 +0000 @@ -156,3 +156,42 @@ } } } + +/** + * Change 'No logs message available.' area plugin type. + */ +function dblog_update_8600() { + $config_factory = \Drupal::configFactory(); + + $view = \Drupal::configFactory()->getEditable('views.view.watchdog'); + if (empty($view)) { + return; + } + + $empty_text = $view->get('display.default.display_options.empty'); + if (!isset($empty_text['area']['content']['value'])) { + return; + } + + // Only update the empty text if is untouched from the original version. + if ($empty_text['area']['id'] == 'area' && + $empty_text['area']['plugin_id'] == 'text' && + $empty_text['area']['field'] == 'area' && + $empty_text['area']['content']['value'] == 'No log messages available.') { + + $new_config = [ + 'id' => 'area_text_custom', + 'table' => 'views', + 'field' => 'area_text_custom', + 'relationship' => 'none', + 'group_type' => 'group', + 'admin_label' => 'No log messages available.', + 'empty' => TRUE, + 'tokenize' => FALSE, + 'content' => 'No log messages available.', + 'plugin_id' => 'text_custom', + ]; + $view->set('display.default.display_options.empty.area', $new_config); + $view->save(); + } +}