Skip to content

Commit

Permalink
Merge pull request #16590 from craftcms/bugfix/16589-allow-saving-fie…
Browse files Browse the repository at this point in the history
…ld-layout-with-just-card-view-conf

allow saving of field layout with no tabs but with card view config
  • Loading branch information
brandonkelly authored Jan 30, 2025
2 parents 9c88b3e + a750513 commit 06eda35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fixed an error that occurred when accessing the `edit/<elementId>` route for a draft that no longer existed.
- Fixed a bug where Matrix fields set to inline-editable blocks view were showing drafts of nested entries.
- Fixed a bug where element card attributes weren’t saving for field layouts that didn’t have any tabs. ([#16589](https://github.com/craftcms/cms/issues/16589))

## 5.6.3 - 2024-01-29

Expand Down
6 changes: 3 additions & 3 deletions src/models/FieldLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -586,12 +586,12 @@ public function getConfig(): ?array
$this->getTabs(),
));

if (empty($tabConfigs)) {
$cardViewConfig = $this->getCardView();

if (empty($tabConfigs) && empty($cardViewConfig)) {
return null;
}

$cardViewConfig = $this->getCardView();

return [
'tabs' => $tabConfigs,
'cardView' => $cardViewConfig,
Expand Down

0 comments on commit 06eda35

Please sign in to comment.