From e80fb5e20f69a2a0739a6aa8f820416de8929d6b Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Thu, 18 May 2023 18:13:20 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20tiers=20not=20appear?= =?UTF-8?q?ing=20on=20custom=20signup=20pages=20(#16828)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs https://github.com/TryGhost/Team/issues/3248 - API queries for tiers are now using the TiersRepository with internal caching - the repository had a bug with it's `toPrimitive()` method which meant the cached tier objects had very few properties - the Tier object has all properties as private getters except for standard `events` property which meant the spread operator didn't have anything to spread into the object resulting in all tiers having a shape like `{events: [], active: true, type: 'paid', id: 'abcd'}` - the `getAll()` method uses nql to match against the cached tier objects but with them not being fully populated it wasn't able to match and so returned an empty array --- - changing the spread to use `tier.toJSON()` means we're populating all of the tier data properly allowing filter matches to work --- ghost/core/core/server/services/tiers/TierRepository.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/core/core/server/services/tiers/TierRepository.js b/ghost/core/core/server/services/tiers/TierRepository.js index 9006ddd976..aa874b60e8 100644 --- a/ghost/core/core/server/services/tiers/TierRepository.js +++ b/ghost/core/core/server/services/tiers/TierRepository.js @@ -49,7 +49,7 @@ module.exports = class TierRepository { */ toPrimitive(tier) { return { - ...tier, + ...tier.toJSON(), active: (tier.status === 'active'), type: tier.type, id: tier.id.toHexString() From 4511fa399653acec6bed32fe339bee84a1063382 Mon Sep 17 00:00:00 2001 From: Ghost CI <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 May 2023 17:31:38 +0000 Subject: [PATCH 2/2] v5.48.1 --- 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 aa84d9ef89..1255f91ad5 100644 --- a/ghost/admin/package.json +++ b/ghost/admin/package.json @@ -1,6 +1,6 @@ { "name": "ghost-admin", - "version": "5.48.0", + "version": "5.48.1", "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 88efd12549..22b50d335f 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -1,6 +1,6 @@ { "name": "ghost", - "version": "5.48.0", + "version": "5.48.1", "description": "The professional publishing platform", "author": "Ghost Foundation", "homepage": "https://ghost.org",