Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 0461909

Browse files
author
Stanislav Idolov
authored
ENGCOM-1508: Fix meta title property #11368
2 parents 2411662 + 54f84cd commit 0461909

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

lib/internal/Magento/Framework/View/Page/Config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ class Config
117117
'description' => null,
118118
'keywords' => null,
119119
'robots' => null,
120+
'title' => null,
120121
];
121122

122123
/**

lib/internal/Magento/Framework/View/Page/Config/Renderer.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ public function renderMetadata()
136136
protected function processMetadataContent($name, $content)
137137
{
138138
$method = 'get' . $this->string->upperCaseWords($name, '_', '');
139+
if ($name === 'title') {
140+
if (!$content) {
141+
$content = $this->escaper->escapeHtml($this->pageConfig->$method()->get());
142+
}
143+
return $content;
144+
}
139145
if (method_exists($this->pageConfig, $method)) {
140146
$content = $this->pageConfig->$method();
141147
}

lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Magento\Framework\View\Page\Config;
1414

1515
/**
16-
* @covers Magento\Framework\View\Page\Config
16+
* @covers \Magento\Framework\View\Page\Config
1717
*
1818
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1919
*/
@@ -139,6 +139,7 @@ public function testMetadata()
139139
'description' => null,
140140
'keywords' => null,
141141
'robots' => null,
142+
'title' => null,
142143
'name' => 'test_value',
143144
'html_encoded' => '<title><span class="test">Test</span></title>',
144145
];

0 commit comments

Comments
 (0)