diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php index 2146a59..4b49743 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php @@ -120,6 +120,7 @@ public function form(array $form, array &$form_state) { // If a filter is missing, it will have been replaced by the null filter. // Remove it here, so that saving the form will remove the missing filter. if ($filter instanceof FilterNull) { + drupal_set_message(t('The %filter filter is missing, and will be removed once this format is saved.', array('%filter' => $filter_id)), 'warning'); $filters->removeInstanceID($filter_id); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilterFormatUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilterFormatUpgradePathTest.php index bf2e13c..12561d7 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilterFormatUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilterFormatUpgradePathTest.php @@ -80,12 +80,14 @@ public function testFilterFormatUpgrade() { // Try to use a filter format with a missing filter, this should not throw // an exception. - check_markup($this->randomName(), 'format_two'); + $empty_markup = check_markup($this->randomName(), 'format_two'); + $this->assertIdentical($empty_markup, '', 'The filtered text is empty while a filter is missing.'); // Editing and saving the format should drop the missing filter. - $this->drupalGet('admin/config/content/formats/format_two'); + $this->drupalGet('admin/config/content/formats/manage/format_two'); + $this->assertRaw(t('The %filter filter is missing, and will be removed once this format is saved.', array('%filter' => 'missing_filter'))); $this->drupalPost(NULL, array(), t('Save configuration')); - drupal_static_reset('filter_formats'); + filter_formats_reset(); $two = filter_format_load('format_two'); $this->assertFalse($two->filters()->has('missing_filter'));