Skip to content

Commit 4810c1d

Browse files
committed
m2-github-issue-5901; Extract handles from layout updates before layout merge step.
1 parent 90200f6 commit 4810c1d

File tree

1 file changed

+15
-0
lines changed
  • lib/internal/Magento/Framework/View/Model/Layout

1 file changed

+15
-0
lines changed

lib/internal/Magento/Framework/View/Model/Layout/Merge.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,21 @@ public function load($handles = [])
462462
return $this;
463463
}
464464

465+
// Walk all updates and extract handles before the merge step.
466+
foreach ($this->updates as $update) {
467+
$updateXml = null;
468+
469+
try {
470+
$updateXml = $this->_loadXmlString($update);
471+
} catch (\Exception $exception) {
472+
// ignore invalid
473+
}
474+
475+
if ($updateXml && strtolower($updateXml->getName()) == 'update' && isset($updateXml['handle'])) {
476+
$this->addHandle((string)$updateXml['handle']);
477+
}
478+
}
479+
465480
foreach ($this->getHandles() as $handle) {
466481
$this->_merge($handle);
467482
}

0 commit comments

Comments
 (0)