Skip to content

Commit

Permalink
3.7.63.1 - Fully fixed #12445
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Jan 10, 2023
1 parent 31013b4 commit fc71732
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 24 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Craft CMS 3.x

## 3.7.63.1 - 2023-01-09

- Fixed a bug where editing certain Matrix/Neo/Super Table fields could result in content loss. ([#12445](https://github.com/craftcms/cms/issues/12445))

## 3.7.63 - 2023-01-04

- Template caching is no longer enabled for tokenized requests. ([#12458](https://github.com/craftcms/cms/issues/12458))
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "craftcms/cms",
"description": "Craft CMS",
"version": "3.7.63",
"version": "3.7.63.1",
"keywords": [
"cms",
"craftcms",
Expand Down
2 changes: 1 addition & 1 deletion src/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
return [
'id' => 'CraftCMS',
'name' => 'Craft CMS',
'version' => '3.7.63',
'version' => '3.7.63.1',
'schemaVersion' => '3.7.33',
'minVersionRequired' => '2.6.2788',
'basePath' => dirname(__DIR__), // Defines the @app alias
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.

29 changes: 9 additions & 20 deletions src/web/assets/cp/src/js/DraftEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1252,13 +1252,7 @@ Craft.DraftEditor = Garnish.Base.extend(
.replace(
new RegExp(`(&fields${lb}[^=]+${rb}${lb})(${idsRE})(${rb})`, 'g'),
(m, pre, id, post) => {
let duplicate = false;
try {
duplicate = this._filterFieldInputName(pre);
} catch (e) {
console.warn(`Unexpected input name: ${m}`);
}
if (!duplicate) {
if (!this._filterFieldInputName(pre)) {
return m;
}
return pre + this.duplicatedElements[id] + post;
Expand All @@ -1270,17 +1264,12 @@ Craft.DraftEditor = Garnish.Base.extend(
(m, name, id) => {
// Ignore param names that end in `[enabled]`, `[type]`, etc.
// (`[sortOrder]` should pass here, which could be set to a specific order index, but *not* `[sortOrder][]`!)
let duplicate = false;
try {
duplicate =
this._filterFieldInputName(name) &&
!name.match(
new RegExp(`${lb}(enabled|sortOrder|type|typeId)${rb}$`)
);
} catch (e) {
console.warn(`Unexpected input name: ${m}`);
}
if (!duplicate) {
if (
!this._filterFieldInputName(name) ||
name.match(
new RegExp(`${lb}(enabled|sortOrder|type|typeId)${rb}$`)
)
) {
return m;
}
return `&${name}=${this.duplicatedElements[id]}`;
Expand All @@ -1298,13 +1287,13 @@ Craft.DraftEditor = Garnish.Base.extend(
const lb = encodeURIComponent('[');
const rb = encodeURIComponent(']');
const nestedNames = name.match(
new RegExp(`(\\bfields|${lb}fields${rb})${lb}[^${rb}]+${rb}`, 'g')
new RegExp(`(\\bfields|${lb}fields${rb})${lb}.+?${rb}`, 'g')
);
if (!nestedNames) {
throw `Unexpected input name: ${name}`;
}
const lastHandle = nestedNames[nestedNames.length - 1].match(
new RegExp(`(?:\\bfields|${lb}fields${rb})${lb}([^${rb}]+)${rb}`)
new RegExp(`(?:\\bfields|${lb}fields${rb})${lb}(.+?)${rb}`)
)[1];
return Craft.fieldsWithoutContent.includes(lastHandle);
},
Expand Down

0 comments on commit fc71732

Please sign in to comment.