Skip to content

Commit 2be5abf

Browse files
author
Stanislav Idolov
authored
ENGCOM-2429: [Backport] Fix meta title property #16948
2 parents 36fb250 + aa34104 commit 2be5abf

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
*/
@@ -137,6 +137,7 @@ public function testMetadata()
137137
'description' => null,
138138
'keywords' => null,
139139
'robots' => null,
140+
'title' => null,
140141
'name' => 'test_value',
141142
'html_encoded' => '<title><span class="test">Test</span></title>',
142143
];

0 commit comments

Comments
 (0)