diff --git a/core/modules/filter/src/FilterFormatListBuilder.php b/core/modules/filter/src/FilterFormatListBuilder.php index 5df6c75..a97b037 100644 --- a/core/modules/filter/src/FilterFormatListBuilder.php +++ b/core/modules/filter/src/FilterFormatListBuilder.php @@ -103,8 +103,7 @@ public function buildRow(EntityInterface $entity) { // Show warning message for disabled text formats. if (!$entity->status()) { - $roles_markup = SafeMarkup::placeholder($this->t('This format has been disabled and is no longer available. - Any content stored with this format will not be displayed.')); + $roles_markup = SafeMarkup::placeholder($this->t('This format has been disabled and is no longer available. Any content stored with this format will not be displayed.')); } $row['roles'] = !empty($this->weightKey) ? array('#markup' => $roles_markup) : $roles_markup; diff --git a/core/modules/filter/src/Form/FilterEnableForm.php b/core/modules/filter/src/Form/FilterEnableForm.php index 70f03c0..42cbd02 100644 --- a/core/modules/filter/src/Form/FilterEnableForm.php +++ b/core/modules/filter/src/Form/FilterEnableForm.php @@ -41,7 +41,7 @@ public function getConfirmText() { * {@inheritdoc} */ public function getDescription() { - return $this->t('You are going to enable text format. Any content stored with this format will be displayed again.'); + return $this->t('Any content stored with this format will be displayed again.'); } /** diff --git a/core/modules/filter/src/Tests/FilterAdminTest.php b/core/modules/filter/src/Tests/FilterAdminTest.php index 7e6a2d3..50b78ba 100644 --- a/core/modules/filter/src/Tests/FilterAdminTest.php +++ b/core/modules/filter/src/Tests/FilterAdminTest.php @@ -156,6 +156,19 @@ function testFormatAdmin() { $this->assertLinkByHref('admin/config/content/formats/manage/' . $format_id . '/disable'); $this->drupalGet('admin/config/content/formats/manage/' . $format_id . '/disable'); $this->drupalPostForm(NULL, array(), t('Disable')); + $this->assertUrl('admin/config/content/formats'); + + // Verify that disabled text format has been disabled and configure and + // disable buttons are not present. + $pattern = '//tr[.//td//a[text() = :label and contains(@href, :href)]]'; + $placeholders = array( + ':href' => '/admin/config/content/formats/manage/' . $format_id, + ); + + $elements = $this->xpath($pattern, array(':label' => t('Disable')) + $placeholders); + $this->assertEqual(0, count($elements), 'Disable button does not exist.'); + $elements = $this->xpath($pattern, array(':label' => t('Configure')) + $placeholders); + $this->assertEqual(0, count($elements), 'Configure button does not exist.'); // Verify that disabled text format no longer exists. $this->drupalGet('admin/config/content/formats/manage/' . $format_id); @@ -180,6 +193,26 @@ function testFormatAdmin() { $this->assertRaw(t('Text format names must be unique. A format named %name already exists.', array( '%name' => $name, ))); + + // Verify that the enable button is present and the disabled text is displayed. + $this->drupalGet('admin/config/content/formats'); + $elements = $this->xpath($pattern, array(':label' => t('Enable')) + $placeholders); + $this->assertEqual(1, count($elements), 'Enable button was found.'); + $this->assertRaw(t('This format has been disabled and is no longer available. Any content stored with this format will not be displayed.')); + + // Enable text format. + $this->drupalGet('admin/config/content/formats/manage/' . $format_id . '/enable'); + $this->drupalPostForm(NULL, array(), t('Enable')); + + // Verify that disabled text format has been enabled again. + $elements = $this->xpath($pattern, array(':label' => t('Disable')) + $placeholders); + $this->assertEqual(1, count($elements), 'Disable button exists.'); + $elements = $this->xpath($pattern, array(':label' => t('Configure')) + $placeholders); + $this->assertEqual(1, count($elements), 'Configure button exists.'); + + // Verify that disabled text format exists again. + $this->drupalGet('admin/config/content/formats/manage/' . $format_id); + $this->assertResponse(200, 'Disabled text format exists again.'); } /**