Skip to content

Commit

Permalink
Merge pull request #14738 from craftcms/bugfix/14731-group-params-by-…
Browse files Browse the repository at this point in the history
…delta-names

go from most to least specific delta names
  • Loading branch information
brandonkelly authored Apr 3, 2024
2 parents b0f048d + 8d3b2bf commit e43933d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Fixed an error that could occur when creating a passkey. ([#14745](https://github.com/craftcms/cms/issues/14745))
- Fixed a bug where the “Utilities” global nav item could get two badge counts.
- Fixed a bug where custom fields whose previous types were missing would lose their values when updating to Craft 5.
- Fixed a bug where Dropdown fields could be marked as invalid on save, if the saved value was invalid and they were initially marked as changed (to the default value) on page load. ([#14738](https://github.com/craftcms/cms/pull/14738))

## 5.0.0 - 2024-03-26

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.

4 changes: 3 additions & 1 deletion src/web/assets/cp/src/js/Craft.js
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,9 @@ $.extend(Craft, {
grouped.__root__ = [];
}

// sort delta names from most to least specific
deltaNames = deltaNames.sort((a, b) => b.length - a.length);

for (let name of deltaNames) {
grouped[name] = [];
}
Expand All @@ -1215,7 +1218,6 @@ $.extend(Craft, {
params = params.map((p) => decodeURIComponent(p));

paramLoop: for (let param of params) {
// loop through the delta names from most -> least specific
for (let name of deltaNames) {
const paramName = param.substring(0, name.length + 1);
if ([`${name}=`, `${name}[`].includes(paramName)) {
Expand Down

0 comments on commit e43933d

Please sign in to comment.