File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
lib/internal/Magento/Framework/View/Model/Layout Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 18
18
* Layout merge model
19
19
* @SuppressWarnings(PHPMD.TooManyFields)
20
20
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
21
+ * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
21
22
*/
22
23
class Merge implements \Magento \Framework \View \Layout \ProcessorInterface
23
24
{
@@ -462,6 +463,8 @@ public function load($handles = [])
462
463
return $ this ;
463
464
}
464
465
466
+ $ this ->extractHandlers ();
467
+
465
468
foreach ($ this ->getHandles () as $ handle ) {
466
469
$ this ->_merge ($ handle );
467
470
}
@@ -951,4 +954,25 @@ public function getCacheId()
951
954
// phpcs:ignore Magento2.Security.InsecureFunction
952
955
return $ this ->generateCacheId (md5 (implode ('| ' , array_merge ($ this ->getHandles (), $ layoutCacheKeys ))));
953
956
}
957
+
958
+ /**
959
+ * Walk all updates and extract handles before the merge step.
960
+ */
961
+ private function extractHandlers (): void
962
+ {
963
+ foreach ($ this ->updates as $ update ) {
964
+ $ updateXml = null ;
965
+
966
+ try {
967
+ $ updateXml = $ this ->_loadXmlString ($ update );
968
+ // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock
969
+ } catch (\Exception $ exception ) {
970
+ // ignore invalid
971
+ }
972
+
973
+ if ($ updateXml && strtolower ($ updateXml ->getName ()) == 'update ' && isset ($ updateXml ['handle ' ])) {
974
+ $ this ->addHandle ((string )$ updateXml ['handle ' ]);
975
+ }
976
+ }
977
+ }
954
978
}
You can’t perform that action at this time.
0 commit comments