From eddcc956930eee4902e26e53371c96a77da81bc2 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Fri, 27 Dec 2024 12:57:58 -0800 Subject: [PATCH] Revert "Filter out field layouts for invalid element types" This reverts commit 0265805f05a1d2af72602ff1455aaa3c4d13d101. Too many bad test fixtures are relying on invalid field layout types to do this for Craft 4. (Already not an issue in Craft 5 though.) --- CHANGELOG.md | 1 - src/services/Fields.php | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d4bbb12105..abcf648300c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,6 @@ - Fixed a bug where custom fields were getting included in rendered field layout forms, even if their `getInputHtml()` method returned an empty string. - Fixed a bug where the password input on the Set Password page wasn’t including the “Show” button. - Fixed a SQL error that could occur if an element was saved with a title longer than 255 characters. -- Fixed errors that could occur when working with field layouts for element types that are no longer installed. ([#16352](https://github.com/craftcms/cms/issues/16352)) - Fixed an RCE vulnerability. ## 4.13.7 - 2024-12-17 diff --git a/src/services/Fields.php b/src/services/Fields.php index 8d4c348a5d5..69dfc959285 100644 --- a/src/services/Fields.php +++ b/src/services/Fields.php @@ -1098,10 +1098,7 @@ private function _layouts(): MemoizableArray { if (!isset($this->_layouts)) { if (Craft::$app->getIsInstalled()) { - $layoutConfigs = $this->_createLayoutQuery()->collect() - ->filter(fn(array $config) => ComponentHelper::validateComponentClass($config['type'], ElementInterface::class)) - ->values() - ->all(); + $layoutConfigs = $this->_createLayoutQuery()->all(); $layoutTabConfigs = ArrayHelper::index($this->_createLayoutTabQuery()->all(), null, ['layoutId']); } else { $layoutConfigs = [];