Skip to content

Commit

Permalink
Fixed #5432
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Jan 14, 2020
1 parent bd226b5 commit bdfb80c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Expand Up @@ -15,6 +15,7 @@
- Fixed couple bugs related to entry preview frames maintaining their scroll position between refreshes. ([#5404](https://github.com/craftcms/cms/issues/5404))
- Fixed a bug where Matrix blocks weren’t getting updated correctly when their field’s Propagation Method setting was changed via `project.yaml`. ([#5295](https://github.com/craftcms/cms/issues/5295))
- Fixed an error that could occur when syncing the project config if a Matrix field had been changed to something else. ([#5419](https://github.com/craftcms/cms/issues/5419))
- Fixed a bug where changes to an entry draft’s name or notes weren’t getting saved until the next draft autosave. ([#5432](https://github.com/craftcms/cms/issues/5432))

### Security
- Fixed XSS vulnerabilities.
Expand Down
10 changes: 3 additions & 7 deletions src/web/assets/cp/dist/js/Craft.js
Expand Up @@ -13405,10 +13405,7 @@ Craft.DraftEditor = Garnish.Base.extend(

// Has anything changed?
var data = this.serializeForm(true);
if (
(data !== Craft.cp.$primaryForm.data('initialSerializedValue')) &&
(force || (data !== this.lastSerializedValue))
) {
if (force || data !== this.lastSerializedValue) {
this.saveDraft(data);
}
},
Expand All @@ -13433,13 +13430,12 @@ Craft.DraftEditor = Garnish.Base.extend(
return;
}

this.lastSerializedValue = data;

if (this.saving) {
this.checkFormAfterUpdate = true;
return;
}

this.lastSerializedValue = data;
this.saving = true;
var $spinners = this.spinners().removeClass('hidden');
var $statusIcons = this.statusIcons().removeClass('invisible checkmark-icon alert-icon').addClass('hidden');
Expand Down Expand Up @@ -13630,7 +13626,7 @@ Craft.DraftEditor = Garnish.Base.extend(

if (this.checkFormAfterUpdate) {
this.checkFormAfterUpdate = false;
this.checkForm(true);
this.checkForm();
}
},

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions src/web/assets/cp/src/js/DraftEditor.js
Expand Up @@ -290,10 +290,7 @@ Craft.DraftEditor = Garnish.Base.extend(

// Has anything changed?
var data = this.serializeForm(true);
if (
(data !== Craft.cp.$primaryForm.data('initialSerializedValue')) &&
(force || (data !== this.lastSerializedValue))
) {
if (force || data !== this.lastSerializedValue) {
this.saveDraft(data);
}
},
Expand All @@ -318,13 +315,12 @@ Craft.DraftEditor = Garnish.Base.extend(
return;
}

this.lastSerializedValue = data;

if (this.saving) {
this.checkFormAfterUpdate = true;
return;
}

this.lastSerializedValue = data;
this.saving = true;
var $spinners = this.spinners().removeClass('hidden');
var $statusIcons = this.statusIcons().removeClass('invisible checkmark-icon alert-icon').addClass('hidden');
Expand Down Expand Up @@ -515,7 +511,7 @@ Craft.DraftEditor = Garnish.Base.extend(

if (this.checkFormAfterUpdate) {
this.checkFormAfterUpdate = false;
this.checkForm(true);
this.checkForm();
}
},

Expand Down

0 comments on commit bdfb80c

Please sign in to comment.