HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: /datos/www/fabricas.colombiatrade.com.co/web_https/core/modules/editor/editor.install
<?php

/**
 * @file
 * Install, update and uninstall functions for the Editor module.
 */

/**
 * Synchronizes the editor status with the paired text format status.
 */
function editor_update_8001() {
  $config_factory = \Drupal::configFactory();
  // Iterate on all text formats config entities.
  foreach ($config_factory->listAll('filter.format.') as $name) {
    list(,, $id) = explode('.', $name, 3);
    $status = $config_factory->get($name)->get('status');
    $editor = $config_factory->getEditable("editor.editor.$id");
    if (!$editor->isNew() && $editor->get('status') !== $status) {
      $editor->set('status', $status)->save();
    }
  }
}