Skip to content

Commit

Permalink
Merge pull request #16178 from craftcms/bugfix/16177-default-table-co…
Browse files Browse the repository at this point in the history
…ls-for-new-custom-source

Bugfix/16177 default table cols for new custom source
  • Loading branch information
brandonkelly authored Nov 22, 2024
2 parents 29ff467 + 9390a9d commit cb1486a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Fixed a bug where `craft\events\ApplyFieldSaveEvent::$field` wasn’t being set consistently by `craft\services\Fields::EVENT_BEFORE_APPLY_FIELD_SAVE`. ([#16156](https://github.com/craftcms/cms/issues/16156))
- Fixed an error that could occur when creating a nested element. ([#16162](https://github.com/craftcms/cms/pull/16162))
- Fixed a bug where custom fields weren’t being displayed at 25% width when they should have. ([#16165](https://github.com/craftcms/cms/pull/16170))
- Fixed a bug where the “Default Table Columns” element source settings could contain duplicate checkbox options. ([#16177](https://github.com/craftcms/cms/issues/16177))

## 5.5.2 - 2024-11-19

Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js.map

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion src/web/assets/cp/src/js/CustomizeSourcesModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,15 @@ Craft.CustomizeSourcesModal.CustomSource =
availableTableAttributes: function () {
const attributes = this.base();
if (this.isNew) {
attributes.push(...this.modal.customFieldAttributes);
let existingFieldAttributes = [];
let customFieldAttributes = [];
this.modal.customFieldAttributes.forEach((item) => {
if (existingFieldAttributes.indexOf(item[0]) == -1) {
existingFieldAttributes.push(item[0]);
customFieldAttributes.push(item);
}
});
attributes.push(...customFieldAttributes);
}
return attributes;
},
Expand Down

0 comments on commit cb1486a

Please sign in to comment.