Subtask of #1830588: [META] remove drupal_set_title() and drupal_get_title()

Problem/Motivation

Using procedural drupal_set_title() inside controller class is not encouraged.

Proposed resolution

Replace drupal_set_title() with #title in page return array.

Remaining tasks

Issue patch

User interface changes

Refer parent issue at #1830588: [META] remove drupal_set_title() and drupal_get_title()

API changes

Refer parent issue at #1830588: [META] remove drupal_set_title() and drupal_get_title()

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vijaycs85’s picture

Status: Active » Needs review
FileSize
1.37 KB

Initial patch...

Status: Needs review » Needs work
Issue tags: -WSCCI Conversions

The last submitted patch, 2102451-filter-title-1.patch, failed testing.

InternetDevels’s picture

Status: Needs work » Needs review
Issue tags: +WSCCI Conversions

#1: 2102451-filter-title-1.patch queued for re-testing.

dawehner’s picture

Status: Needs review » Needs work
+++ b/core/modules/filter/lib/Drupal/filter/FilterFormatAddFormController.php
@@ -16,7 +16,7 @@ class FilterFormatAddFormController extends FilterFormatFormControllerBase {
   public function form(array $form, array &$form_state) {
-    drupal_set_title('Add text format');
+    $form['#title'] = $this->t('Add text format');
     return parent::form($form, $form_state);
   }

I think we should just put the title onto the route definition here.

sidharthap’s picture

Status: Needs work » Needs review
FileSize
1.74 KB

Thanks @dawehner and @Vijaycs85
Corrected #4.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Thank you

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.