diff --git a/core/modules/filter/src/Element/ProcessedText.php b/core/modules/filter/src/Element/ProcessedText.php index 767976a..39a7a9e 100644 --- a/core/modules/filter/src/Element/ProcessedText.php +++ b/core/modules/filter/src/Element/ProcessedText.php @@ -78,10 +78,13 @@ public static function preRenderText($element) { if (!isset($format_id)) { $format_id = static::configFactory()->get('filter.settings')->get('fallback_format'); } - // If the requested text format does not exist, the text cannot be filtered. /** @var \Drupal\filter\Entity\FilterFormat $format **/ - if (!($format = FilterFormat::load($format_id)) || !$format->get('status')) { - static::logger('filter')->alert('Missing text format: %format.', array('%format' => $format_id)); + $format = FilterFormat::load($format_id); + // If the requested text format doesn't exist or it's disabled, the text + // cannot be filtered. + if (!$format || $format->get('status')) { + $message = !$format ? 'Missing text format: %format.' : 'Disabled text format: %format.'; + static::logger('filter')->alert($message, array('%format' => $format_id)); $element['#markup'] = ''; return $element; } diff --git a/core/modules/filter/src/Tests/FilterAdminTest.php b/core/modules/filter/src/Tests/FilterAdminTest.php index 3796f42..e41ac12 100644 --- a/core/modules/filter/src/Tests/FilterAdminTest.php +++ b/core/modules/filter/src/Tests/FilterAdminTest.php @@ -412,7 +412,7 @@ public function testDisabledFormat() { $format->setFilterConfig('filter_static_text', ['status' => TRUE]); $format->save(); - // Create a new of the new node type. + // Create a new node of the new node type. $node = Node::create([ 'type' => $node_type->id(), 'title' => $this->randomString(),