Skip to content

Commit

Permalink
Revert "Filter out field layouts for invalid element types"
Browse files Browse the repository at this point in the history
This reverts commit 0265805.

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.)
  • Loading branch information
brandonkelly committed Dec 27, 2024
1 parent 0265805 commit eddcc95
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions src/services/Fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down

0 comments on commit eddcc95

Please sign in to comment.