diff --git a/core/lib/Drupal/Core/Controller/HtmlPageController.php b/core/lib/Drupal/Core/Controller/HtmlPageController.php index d950e9d..3c9f4a0 100644 --- a/core/lib/Drupal/Core/Controller/HtmlPageController.php +++ b/core/lib/Drupal/Core/Controller/HtmlPageController.php @@ -55,18 +55,10 @@ public function content(Request $request, $_content) { if (!is_array($page_content)) { $page_content = array( '#markup' => $page_content, + '#title' => '', ); } - // createController() will usually return a callable in array format, - // but it's not guaranteed. - $obj = NULL; - if (is_array($callable)) { - list($obj, $method) = $callable; - } - if (is_object($obj) && $obj instanceof TitleControllerInterface) { - $page_content['#title'] = $obj->getTitle($request); - } - elseif ($request->attributes->has('_title')) { + if ($request->attributes->has('_title')) { $page_content['#title'] = $request->attributes->get('_title'); } diff --git a/core/modules/system/tests/modules/test_page_test/lib/Drupal/test_page_test/Controller/Test.php b/core/modules/system/tests/modules/test_page_test/lib/Drupal/test_page_test/Controller/Test.php index e82d97a..9263dd5 100644 --- a/core/modules/system/tests/modules/test_page_test/lib/Drupal/test_page_test/Controller/Test.php +++ b/core/modules/system/tests/modules/test_page_test/lib/Drupal/test_page_test/Controller/Test.php @@ -7,13 +7,12 @@ namespace Drupal\test_page_test\Controller; -use Drupal\Core\Controller\TitleControllerInterface; use Symfony\Component\HttpFoundation\Request; /** * Defines a test controller for page titles. */ -class Test implements TitleControllerInterface { +class Test { /** * Renders a page with a title. @@ -24,15 +23,9 @@ class Test implements TitleControllerInterface { public function renderTitle() { $build = array(); $build['#markup'] = t('Hello Drupal'); + $build['#Foo'] = t('Foo'); return $build; } - /** - * {@inheritdoc} - */ - public function getTitle(Request $request) { - return t('Foo'); - } - }