From f02aabb3d2ea6cbc9351c61a44cd435a04301d95 Mon Sep 17 00:00:00 2001 From: Dries Date: Tue, 5 Nov 2013 20:57:03 -0500 Subject: [PATCH] Issue #2102459 by alexpott, vijaycs85, InternetDevels: Remove drupal_set_title() in Image module controllers. --- .../image/lib/Drupal/image/Form/ImageStyleEditForm.php | 6 +----- .../image/lib/Drupal/image/Tests/ImageAdminStylesTest.php | 5 +++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php b/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php index 8381a8a5e1c..50c665e2da2 100644 --- a/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php +++ b/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php @@ -52,11 +52,7 @@ class ImageStyleEditForm extends ImageStyleFormBase { * {@inheritdoc} */ public function form(array $form, array &$form_state) { - - // @todo Remove drupal_set_title() in http://drupal.org/node/1981644 - $title = $this->t('Edit style %name', array('%name' => $this->entity->label())); - drupal_set_title($title, PASS_THROUGH); - + $form['#title'] = $this->t('Edit style %name', array('%name' => $this->entity->label())); $form['#tree'] = TRUE; $form['#attached']['css'][drupal_get_path('module', 'image') . '/css/image.admin.css'] = array(); diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php index 462b6e59bf5..c944ddd5541 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php @@ -167,7 +167,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase { // Test the style overview form. // Change the name of the style and adjust the weights of effects. $style_name = strtolower($this->randomName(10)); - $style_label = $this->randomString(); + $style_label = $this->randomName(); $weight = count($effect_edits); $edit = array( 'name' => $style_name, @@ -189,7 +189,8 @@ class ImageAdminStylesTest extends ImageFieldTestBase { // Check that the URL was updated. $this->drupalGet($style_path); - $this->assertResponse(200, format_string('Image style %original renamed to %new', array('%original' => $style->label(), '%new' => $style_name))); + $this->assertTitle(t('Edit style @name | Drupal', array('@name' => $style_label))); + $this->assertResponse(200, format_string('Image style %original renamed to %new', array('%original' => $style->id(), '%new' => $style_name))); // Check that the image was flushed after updating the style. // This is especially important when renaming the style. Make sure that