Skip to content

Commit 02049c4

Browse files
author
Oleksandr Karpenko
committed
MAGETWO-49766: HTML head Design Configurations are used in Admin
1 parent 901637a commit 02049c4

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

app/code/Magento/Backend/etc/adminhtml/di.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,9 @@
133133
</arguments>
134134
</type>
135135
<preference for="Magento\Framework\App\Router\PathConfigInterface" type="Magento\Backend\Model\AdminPathConfig" />
136+
<type name="Magento\Framework\View\Page\Config">
137+
<arguments>
138+
<argument name="isIncludesAvailable" xsi:type="boolean">false</argument>
139+
</arguments>
140+
</type>
136141
</config>

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ class Config
122122
*/
123123
private $areaResolver;
124124

125+
/**
126+
* @var bool
127+
*/
128+
private $isIncludesAvailable;
129+
125130
/**
126131
* This getter serves as a workaround to add this dependency to this class without breaking constructor structure.
127132
*
@@ -145,21 +150,24 @@ private function getAreaResolver()
145150
* @param \Magento\Framework\View\Page\FaviconInterface $favicon
146151
* @param Title $title
147152
* @param \Magento\Framework\Locale\ResolverInterface $localeResolver
153+
* @param bool $isIncludesAvailable
148154
*/
149155
public function __construct(
150156
View\Asset\Repository $assetRepo,
151157
View\Asset\GroupedCollection $pageAssets,
152158
App\Config\ScopeConfigInterface $scopeConfig,
153159
View\Page\FaviconInterface $favicon,
154160
Title $title,
155-
\Magento\Framework\Locale\ResolverInterface $localeResolver
161+
\Magento\Framework\Locale\ResolverInterface $localeResolver,
162+
$isIncludesAvailable = true
156163
) {
157164
$this->assetRepo = $assetRepo;
158165
$this->pageAssets = $pageAssets;
159166
$this->scopeConfig = $scopeConfig;
160167
$this->favicon = $favicon;
161168
$this->title = $title;
162169
$this->localeResolver = $localeResolver;
170+
$this->isIncludesAvailable = $isIncludesAvailable;
163171
$this->setElementAttribute(
164172
self::ELEMENT_TYPE_HTML,
165173
self::HTML_ATTRIBUTE_LANG,
@@ -555,7 +563,7 @@ public function getDefaultFavicon()
555563
*/
556564
public function getIncludes()
557565
{
558-
if (empty($this->includes)) {
566+
if (empty($this->includes) && $this->isIncludesAvailable) {
559567
$this->includes = $this->scopeConfig->getValue(
560568
'design/head/includes',
561569
\Magento\Store\Model\ScopeInterface::SCOPE_STORE

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ protected function setUp()
9292
'scopeConfig' => $this->scopeConfig,
9393
'favicon' => $this->favicon,
9494
'localeResolver' => $locale,
95+
'includesAreas' => [
96+
'frontend'
97+
]
9598
]
9699
);
97100

0 commit comments

Comments
 (0)