5 * Install, update and uninstall functions for the Editor module.
9 * Synchronizes the editor status with the paired text format status.
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();