From b504571f0b2f6cf2a2a26e7f5a772de6bcbbf510 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Tue, 9 Oct 2018 10:38:29 -0700 Subject: [PATCH] Fixed #3354 --- CHANGELOG-v3.md | 1 + src/fields/Matrix.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-v3.md b/CHANGELOG-v3.md index a9a36dbdb9f..6bd60e414bb 100644 --- a/CHANGELOG-v3.md +++ b/CHANGELOG-v3.md @@ -25,6 +25,7 @@ - Fixed a bug where details panes weren’t visible on browser windows sized between 999 and 1,223 pixels wide. - Fixed an error that occurred if a Quick Post widget contained a Matrix field that had Min Blocks set and only had one block type. - Fixed a bug where the Plugin Store was not working properly with Internet Explorer. +- Fixed a bug where disabled Matrix blocks were getting validated as live. ([#3354](https://github.com/craftcms/cms/issues/3354)) ### Security - The `svg()` Twig function no longer sanitizes SVGs or namespaces their IDs or class names by default when a file path (or alias) was passed in. ([#3337](https://github.com/craftcms/cms/issues/3337)) diff --git a/src/fields/Matrix.php b/src/fields/Matrix.php index 387ed676b25..a0740668173 100644 --- a/src/fields/Matrix.php +++ b/src/fields/Matrix.php @@ -547,7 +547,7 @@ public function validateBlocks(ElementInterface $element) foreach ($value->all() as $i => $block) { /** @var MatrixBlock $block */ - if ($element->getScenario() === Element::SCENARIO_LIVE) { + if ($block->enabled && $element->getScenario() === Element::SCENARIO_LIVE) { $block->setScenario(Element::SCENARIO_LIVE); }