From db0081ccaf4229d595b8baee499ef0f590a6e5a1 Mon Sep 17 00:00:00 2001 From: Michael Barrett <991592+mike182uk@users.noreply.github.com> Date: Wed, 21 Jun 2023 15:12:19 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20revision=20save=20re?= =?UTF-8?q?verting=20newly=20published=20post=20to=20draft=20(#17083)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes https://github.com/TryGhost/Ghost/issues/17076 When a post is saved `_revisionSaveTask` gets queued to execute 10 minutes from the save. When a post is published via the publish modal `_revisionSaveTask` does not get dequeued. When `_revisionSaveTask` gets executed at the 10 minute mark it is assumed that it is ok to save a revision, which will cause the post to be reverted back to a draft. This change enforces another check during the task exection to ensure that it is in fact still ok to save a revision (in case anything has changed in the 10 minutes since the task queued, i.e the post being published) --- ghost/admin/app/controllers/lexical-editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/controllers/lexical-editor.js b/ghost/admin/app/controllers/lexical-editor.js index bce22d4d1a..ef3a3ba019 100644 --- a/ghost/admin/app/controllers/lexical-editor.js +++ b/ghost/admin/app/controllers/lexical-editor.js @@ -1059,7 +1059,9 @@ export default class LexicalEditorController extends Controller { while (config.environment !== 'test' && true) { yield timeout(REVISIONSAVE_TIMEOUT); - this.autosaveTask.perform({saveRevision: true}); + this.autosaveTask.perform({ + saveRevision: this._canAutosave + }); } }).drop()) _revisionSaveTask; From b7cad4e8fb3463ef0487775f028008b4fa9de4db Mon Sep 17 00:00:00 2001 From: Ghost CI <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 21 Jun 2023 15:37:57 +0000 Subject: [PATCH 2/2] v5.52.3 --- ghost/admin/package.json | 2 +- ghost/core/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/admin/package.json b/ghost/admin/package.json index c0c86bb9db..130b10b885 100644 --- a/ghost/admin/package.json +++ b/ghost/admin/package.json @@ -1,6 +1,6 @@ { "name": "ghost-admin", - "version": "5.52.2", + "version": "5.52.3", "description": "Ember.js admin client for Ghost", "author": "Ghost Foundation", "homepage": "http://ghost.org", diff --git a/ghost/core/package.json b/ghost/core/package.json index e7d49a6560..8e62a34231 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -1,6 +1,6 @@ { "name": "ghost", - "version": "5.52.2", + "version": "5.52.3", "description": "The professional publishing platform", "author": "Ghost Foundation", "homepage": "https://ghost.org",