diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d0d332d516..b96b79fa8dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Updated Twig to 3.14. ([#15704](https://github.com/craftcms/cms/issues/15704)) - Fixed a bug where address’ Label fields were being marked as translatable. ([#15702](https://github.com/craftcms/cms/pull/15702)) +- Fixed an error that could occur when saving an entry with a Matrix field, if the nested entries didn’t have slugs. - Fixed an RCE vulnerability. ## 5.4.2 - 2024-09-06 diff --git a/src/base/Element.php b/src/base/Element.php index ee8915a017e..785433bf668 100644 --- a/src/base/Element.php +++ b/src/base/Element.php @@ -2638,7 +2638,7 @@ protected function defineRules(): array ['slug'], 'required', 'when' => fn() => (bool)preg_match('/\bslug\b/', $this->getUriFormat() ?? ''), - 'on' => [self::SCENARIO_DEFAULT, self::SCENARIO_LIVE, self::SCENARIO_ESSENTIALS], + 'on' => [self::SCENARIO_DEFAULT, self::SCENARIO_LIVE], ]; $rules[] = [['uri'], ElementUriValidator::class, 'on' => [self::SCENARIO_DEFAULT, self::SCENARIO_LIVE, self::SCENARIO_ESSENTIALS]]; }