Loading core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php +4 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,10 @@ public function isOverridable() { */ public function setOverridable($overridable = TRUE) { $this->setThirdPartySetting('layout_builder', 'allow_custom', $overridable); // Enable Layout Builder if it's not already enabled and overriding. if ($overridable && !$this->isLayoutBuilderEnabled()) { $this->enableLayoutBuilder(); } return $this; } Loading core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php +16 −0 Original line number Diff line number Diff line Loading @@ -61,4 +61,20 @@ public function testGetRuntimeSections() { $this->assertEquals($this->sectionStorage->getSections(), $result); } /** * Tests that setting overridable enables Layout Builder only when set to TRUE. */ public function testSetOverridable() { // Disable Layout Builder. $this->sectionStorage->disableLayoutBuilder(); // Set Overridable to TRUE and ensure Layout Builder is enabled. $this->sectionStorage->setOverridable(); $this->assertEquals($this->sectionStorage->isLayoutBuilderEnabled(), TRUE); // Ensure Layout Builder is still enabled after setting Overridable to FALSE. $this->sectionStorage->setOverridable(FALSE); $this->assertEquals($this->sectionStorage->isLayoutBuilderEnabled(), TRUE); } } Loading
core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php +4 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,10 @@ public function isOverridable() { */ public function setOverridable($overridable = TRUE) { $this->setThirdPartySetting('layout_builder', 'allow_custom', $overridable); // Enable Layout Builder if it's not already enabled and overriding. if ($overridable && !$this->isLayoutBuilderEnabled()) { $this->enableLayoutBuilder(); } return $this; } Loading
core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php +16 −0 Original line number Diff line number Diff line Loading @@ -61,4 +61,20 @@ public function testGetRuntimeSections() { $this->assertEquals($this->sectionStorage->getSections(), $result); } /** * Tests that setting overridable enables Layout Builder only when set to TRUE. */ public function testSetOverridable() { // Disable Layout Builder. $this->sectionStorage->disableLayoutBuilder(); // Set Overridable to TRUE and ensure Layout Builder is enabled. $this->sectionStorage->setOverridable(); $this->assertEquals($this->sectionStorage->isLayoutBuilderEnabled(), TRUE); // Ensure Layout Builder is still enabled after setting Overridable to FALSE. $this->sectionStorage->setOverridable(FALSE); $this->assertEquals($this->sectionStorage->isLayoutBuilderEnabled(), TRUE); } }