Skip to content

Commit 8b1c5a0

Browse files
committed
Merge remote-tracking branch 'origin/AC-15674' into spartans_pr_29102025
2 parents 4aa84d4 + 4ebc92f commit 8b1c5a0

File tree

2 files changed

+14
-9
lines changed
  • app/code/Magento/Theme/view/frontend/layout
  • dev/tests/integration/testsuite/Magento/PageCache/Model/Layout

2 files changed

+14
-9
lines changed

app/code/Magento/Theme/view/frontend/layout/default.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<arguments>
7474
<argument name="title" translate="true" xsi:type="string">Menu</argument>
7575
</arguments>
76-
<block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="Magento_Theme::html/topmenu.phtml" ttl="3600" before="-"/>
76+
<block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="Magento_Theme::html/topmenu.phtml" before="-"/>
7777
</block>
7878
<block class="Magento\Framework\View\Element\Text" name="store.links" group="navigation-sections">
7979
<arguments>

dev/tests/integration/testsuite/Magento/PageCache/Model/Layout/MergeTest.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2016 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento\PageCache\Model\Layout;
77

@@ -15,7 +15,7 @@ class MergeTest extends \PHPUnit\Framework\TestCase
1515
public function testLoadEntitySpecificHandleWithEsiBlock()
1616
{
1717
$this->expectException(\LogicException::class);
18-
$this->expectExceptionMessage('Handle \'default\' must not contain blocks with \'ttl\' attribute specified');
18+
$this->expectExceptionMessage('must not contain blocks with \'ttl\' attribute specified');
1919

2020
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
2121

@@ -29,10 +29,15 @@ public function testLoadEntitySpecificHandleWithEsiBlock()
2929

3030
/** @var EntitySpecificHandlesList $entitySpecificHandleList */
3131
$entitySpecificHandleList = $objectManager->get(EntitySpecificHandlesList::class);
32-
// Add 'default' handle, which has declarations of blocks with ttl, to the list of entity specific handles.
33-
// This allows to simulate a situation, when block with ttl attribute
34-
// is declared e.g. in 'catalog_product_view_id_1' handle
35-
$entitySpecificHandleList->addHandle('default');
36-
$layoutMerge->load(['default']);
32+
33+
// Register test handle as entity-specific
34+
$testHandle = 'default';
35+
$entitySpecificHandleList->addHandle($testHandle);
36+
37+
// Simple XML with ttl attribute that should trigger the validation
38+
$layoutXml = '<block class="Magento\Framework\View\Element\Template" name="test.block" ttl="3600"/>';
39+
40+
// This should throw exception because the handle is entity-specific and contains ttl
41+
$layoutMerge->validateUpdate($testHandle, $layoutXml);
3742
}
3843
}

0 commit comments

Comments
 (0)