From ae05f8120c434c4fdc6cf151d5ef8b8eb9e595fe Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Wed, 28 Nov 2018 14:31:10 -0800 Subject: [PATCH] Fixed #3499 --- CHANGELOG-v3.md | 5 +++++ src/services/Matrix.php | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-v3.md b/CHANGELOG-v3.md index 9f5b61a38dc..9c6bbc93f9c 100644 --- a/CHANGELOG-v3.md +++ b/CHANGELOG-v3.md @@ -1,5 +1,10 @@ # Release Notes for Craft CMS 3.x +## Unreleased + +### Fixed +- Fixed a bug where new Matrix blocks wouldn’t remember that they were supposed to be collapsed if “Save and continue editing” was clicked. ([#3499](https://github.com/craftcms/cms/issues/3499)) + ## 3.0.33 - 2018-11-27 ### Changed diff --git a/src/services/Matrix.php b/src/services/Matrix.php index 195578352f8..e8ccd2bef2d 100644 --- a/src/services/Matrix.php +++ b/src/services/Matrix.php @@ -29,6 +29,7 @@ use craft\models\MatrixBlockType; use craft\records\MatrixBlockType as MatrixBlockTypeRecord; use craft\web\assets\matrix\MatrixAsset; +use craft\web\View; use yii\base\Component; use yii\base\Exception; @@ -713,7 +714,7 @@ public function saveField(MatrixField $field, ElementInterface $owner) Craft::$app->getSession()->addAssetBundleFlash(MatrixAsset::class); foreach ($collapsedBlockIds as $blockId) { - Craft::$app->getSession()->addJsFlash('Craft.MatrixInput.rememberCollapsedBlockId(' . $blockId . ');'); + Craft::$app->getSession()->addJsFlash('Craft.MatrixInput.rememberCollapsedBlockId(' . $blockId . ');', View::POS_END); } } }