From 3a9016639cb58759bbe852859d64077414cc5a48 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Tue, 23 Aug 2022 16:39:47 +0200 Subject: [PATCH] Fixed page actions stored under page resource type refs https://github.com/TryGhost/Ghost/commit/bde9b842212c277cf51bebaa981df9382c71d121 - the commit above claimed to fix an issue where actions taken on pages were stored using the `post` resource type - whilst it does that, this actually breaks part of the API because we use the `resource_type` to join on tables when doing an `include=resource` - this commit reverts that functionality and instead stores the type in the `context` field so we can still differentiate between pages and posts --- ghost/core/core/server/models/post.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ghost/core/core/server/models/post.js b/ghost/core/core/server/models/post.js index a5b931e012..842c101590 100644 --- a/ghost/core/core/server/models/post.js +++ b/ghost/core/core/server/models/post.js @@ -39,9 +39,7 @@ Post = ghostBookshelf.Model.extend({ tableName: 'posts', actionsCollectCRUD: true, - actionsResourceType: function () { - return this.get('type') || this.previous('type'); - }, + actionsExtraContext: ['type'], /** * @NOTE