From b9c29893258e8fe3f3d793e5e35885995c584cc8 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 1 Nov 2023 11:53:29 +0000 Subject: [PATCH] Cleaned up unused Post.statusScratch property (#18817) no issue - remnant from earlier code that is no longer needed/used --- ghost/admin/app/controllers/lexical-editor.js | 2 -- ghost/admin/app/models/post.js | 4 ---- ghost/admin/app/validators/post.js | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/ghost/admin/app/controllers/lexical-editor.js b/ghost/admin/app/controllers/lexical-editor.js index 7d89311fd1..ecd2225159 100644 --- a/ghost/admin/app/controllers/lexical-editor.js +++ b/ghost/admin/app/controllers/lexical-editor.js @@ -475,8 +475,6 @@ export default class LexicalEditorController extends Controller { try { let post = yield this._savePostTask.perform({...options, adapterOptions}); - post.set('statusScratch', null); - // Clear any error notification (if any) this.notifications.clearAll(); diff --git a/ghost/admin/app/models/post.js b/ghost/admin/app/models/post.js index 9f6ec1bccb..3cbc4b01a7 100644 --- a/ghost/admin/app/models/post.js +++ b/ghost/admin/app/models/post.js @@ -136,10 +136,6 @@ export default Model.extend(Comparable, ValidationEngine, { lexicalScratch: null, titleScratch: null, - // HACK: used for validation so that date/time can be validated based on - // eventual status rather than current status - statusScratch: null, - // For use by date/time pickers - will be validated then converted to UTC // on save. Updated by an observer whenever publishedAtUTC changes. // Everything that revolves around publishedAtUTC only cares about the saved diff --git a/ghost/admin/app/validators/post.js b/ghost/admin/app/validators/post.js index 73aa67505b..f6ab868a99 100644 --- a/ghost/admin/app/validators/post.js +++ b/ghost/admin/app/validators/post.js @@ -183,7 +183,7 @@ export default BaseValidator.create({ // don't validate the date if the time format is incorrect if (isEmpty(model.errors.errorsFor('publishedAtBlogTime'))) { - let status = model.statusScratch || model.status; + let status = model.status; let now = moment(); let publishedAtBlogTZ = model.publishedAtBlogTZ; let isInFuture = publishedAtBlogTZ.isSameOrAfter(now);