Version 1
[yaffs-website] / web / core / modules / editor / editor.install
1 <?php
2
3 /**
4  * @file
5  * Install, update and uninstall functions for the Editor module.
6  */
7
8 /**
9  * Synchronizes the editor status with the paired text format status.
10  */
11 function editor_update_8001() {
12   $config_factory = \Drupal::configFactory();
13   // Iterate on all text formats config entities.
14   foreach ($config_factory->listAll('filter.format.') as $name) {
15     list(,, $id) = explode('.', $name, 3);
16     $status = $config_factory->get($name)->get('status');
17     $editor = $config_factory->getEditable("editor.editor.$id");
18     if (!$editor->isNew() && $editor->get('status') !== $status) {
19       $editor->set('status', $status)->save();
20     }
21   }
22 }