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 827e31b..1a4981a 100644 --- a/core/modules/editor/lib/Drupal/editor/Plugin/InPlaceEditor/Editor.php +++ b/core/modules/editor/lib/Drupal/editor/Plugin/InPlaceEditor/Editor.php @@ -68,7 +68,9 @@ protected function textFormatHasTransformationFilters($format_id) { * Implements \Drupal\edit\EditPluginInterface::getAttachments(). */ public function getAttachments() { - $user_format_ids = array_keys(filter_formats(\Drupal::currentUser())); + global $user; + + $user_format_ids = array_keys(filter_formats($user)); $manager = \Drupal::service('plugin.manager.editor'); $definitions = $manager->getDefinitions(); diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index 84408b8..28dcffe 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -310,8 +310,9 @@ function filter_get_formats_by_role($rid) { * @see filter_fallback_format() */ function filter_default_format(AccountInterface $account = NULL) { + global $user; if (!isset($account)) { - $account = Drupal::currentUser(); + $account = $user; } // Get a list of formats for this user, ordered by weight. The first one // available is the user's default format. @@ -685,6 +686,8 @@ function check_markup($text, $format_id = NULL, $langcode = '', $cache = FALSE, * The expanded element. */ function filter_process_format($element) { + global $user; + // Ensure that children appear as subkeys of this element. $element['#tree'] = TRUE; $blacklist = array( @@ -727,7 +730,6 @@ function filter_process_format($element) { ); // Get a list of formats that the current user has access to. - $user = Drupal::currentUser(); $formats = filter_formats($user); // Use the default format for this user if none was selected. @@ -878,7 +880,9 @@ function theme_text_format_wrapper($variables) { * - id: Filter ID. */ function _filter_tips($format_id, $long = FALSE) { - $formats = filter_formats(Drupal::currentUser()); + global $user; + + $formats = filter_formats($user); $tips = array();