Skip to content

Commit e002aa3

Browse files
committed
Remove custom fields’ card view checkboxes when removed from field layouts
1 parent 92d6a15 commit e002aa3

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Fixed a bug where object templates that included another template were missing variables. ([#18165](https://github.com/craftcms/cms/issues/18165))
1515
- Fixed a JavaScript error that could occur if two control panel animations were triggered simultaneously.
1616
- Fixed a bug where it wasn’t possible to copy/paste nested entries within Matrix fields set to the inline-editable blocks view mode, for unpublished owner elements. ([#18185](https://github.com/craftcms/cms/pull/18185))
17+
- Fixed a bug where custom fields’ checkboxes weren’t getting removed from field layouts’ “Card Attributes” lists when removed from the layout.
1718

1819
## 5.8.21 - 2025-12-04
1920

src/web/assets/cp/dist/cp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/assets/cp/dist/cp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/assets/cp/src/js/FieldLayoutDesigner.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,15 +1426,14 @@ Craft.FieldLayoutDesigner.Element = Garnish.Base.extend({
14261426
},
14271427

14281428
destroy: function () {
1429-
if (
1430-
this.tab.designer.settings.withCardViewDesigner &&
1431-
this.config.providesThumbs
1432-
) {
1429+
if (this.tab.designer.settings.withCardViewDesigner) {
14331430
let cvd = this.tab.designer.$cvd?.data('cvd');
1434-
cvd.showThumb = false;
1435-
14361431
cvd.removeCheckbox(this.uid);
1437-
cvd.updateThumbnailsDropdown(this, 'remove');
1432+
1433+
if (this.config.providesThumbs) {
1434+
cvd.showThumb = false;
1435+
cvd.updateThumbnailsDropdown(this, 'remove');
1436+
}
14381437

14391438
cvd.updatePreview();
14401439
}

0 commit comments

Comments
 (0)