Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/dblog/dblog.install @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
comparison
equal
deleted
inserted
replaced
3:307d7a7fd348 | 4:a9cd425dd02b |
---|---|
154 if ($save) { | 154 if ($save) { |
155 $view->save(); | 155 $view->save(); |
156 } | 156 } |
157 } | 157 } |
158 } | 158 } |
159 | |
160 /** | |
161 * Change 'No logs message available.' area plugin type. | |
162 */ | |
163 function dblog_update_8600() { | |
164 $config_factory = \Drupal::configFactory(); | |
165 | |
166 $view = \Drupal::configFactory()->getEditable('views.view.watchdog'); | |
167 if (empty($view)) { | |
168 return; | |
169 } | |
170 | |
171 $empty_text = $view->get('display.default.display_options.empty'); | |
172 if (!isset($empty_text['area']['content']['value'])) { | |
173 return; | |
174 } | |
175 | |
176 // Only update the empty text if is untouched from the original version. | |
177 if ($empty_text['area']['id'] == 'area' && | |
178 $empty_text['area']['plugin_id'] == 'text' && | |
179 $empty_text['area']['field'] == 'area' && | |
180 $empty_text['area']['content']['value'] == 'No log messages available.') { | |
181 | |
182 $new_config = [ | |
183 'id' => 'area_text_custom', | |
184 'table' => 'views', | |
185 'field' => 'area_text_custom', | |
186 'relationship' => 'none', | |
187 'group_type' => 'group', | |
188 'admin_label' => 'No log messages available.', | |
189 'empty' => TRUE, | |
190 'tokenize' => FALSE, | |
191 'content' => 'No log messages available.', | |
192 'plugin_id' => 'text_custom', | |
193 ]; | |
194 $view->set('display.default.display_options.empty.area', $new_config); | |
195 $view->save(); | |
196 } | |
197 } |