diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module index 0f317b9..d1ae4b8 100644 --- a/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -130,7 +130,7 @@ function editor_form_filter_admin_overview_alter(&$form, $form_state) { $form['formats']['#header'] = array_merge($start, $form['formats']['#header']); // Then splice in the name of each text editor for each text format. - $editors = drupal_container()->get('plugin.manager.editor')->getDefinitions(); + $editors = Drupal::service('plugin.manager.editor')->getDefinitions(); foreach (element_children($form['formats']) as $format_id) { $editor = editor_load($format_id); $editor_name = ($editor && isset($editors[$editor->editor])) ? $editors[$editor->editor]['label'] : drupal_placeholder('—'); @@ -148,7 +148,7 @@ function editor_form_filter_admin_format_form_alter(&$form, &$form_state) { if (!isset($form_state['editor'])) { $format_id = $form['#format']->format; $form_state['editor'] = editor_load($format_id); - $form_state['editor_manager'] = drupal_container()->get('plugin.manager.editor'); + $form_state['editor_manager'] = Drupal::service('plugin.manager.editor'); } $editor = $form_state['editor']; $manager = $form_state['editor_manager']; @@ -324,7 +324,7 @@ function editor_pre_render_format($element) { $element['#attached']['library'][] = array('editor', 'drupal.editor'); // Attach attachments for all available editors. - $manager = drupal_container()->get('plugin.manager.editor'); + $manager = Drupal::service('plugin.manager.editor'); $element['#attached'] = NestedArray::mergeDeep($element['#attached'], $manager->getAttachments($format_ids)); return $element; diff --git a/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php b/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php index 00eae37..710b991 100644 --- a/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php +++ b/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php @@ -74,7 +74,7 @@ public function label($langcode = NULL) { public function __construct(array $values, $entity_type) { parent::__construct($values, $entity_type); - $manager = drupal_container()->get('plugin.manager.editor'); + $manager = \Drupal::service('plugin.manager.editor'); $plugin = $manager->createInstance($this->editor); // Initialize settings, merging module-provided defaults. diff --git a/core/modules/editor/lib/Drupal/editor/Plugin/InPlaceEditor/Editor.php b/core/modules/editor/lib/Drupal/editor/Plugin/InPlaceEditor/Editor.php index 0a056fb..fcd2e4f 100644 --- a/core/modules/editor/lib/Drupal/editor/Plugin/InPlaceEditor/Editor.php +++ b/core/modules/editor/lib/Drupal/editor/Plugin/InPlaceEditor/Editor.php @@ -40,7 +40,7 @@ function isCompatible(FieldInstance $instance, array $items) { elseif (!empty($instance['settings']['text_processing'])) { $format_id = $items[0]['format']; if (isset($format_id) && $editor = editor_load($format_id)) { - $definition = drupal_container()->get('plugin.manager.editor')->getDefinition($editor->editor); + $definition = \Drupal::service('plugin.manager.editor')->getDefinition($editor->editor); if ($definition['supports_inline_editing'] === TRUE) { return TRUE; } @@ -74,7 +74,7 @@ public function getAttachments() { global $user; $user_format_ids = array_keys(filter_formats($user)); - $manager = drupal_container()->get('plugin.manager.editor'); + $manager = \Drupal::service('plugin.manager.editor'); $definitions = $manager->getDefinitions(); // Filter the current user's formats to those that support inline editing.