Skip to content

Commit

Permalink
🐛 Fixed free tier showing in the tiers-only paywall in posts (TryGhos…
Browse files Browse the repository at this point in the history
…t#19807)

refs INC-36
fixes TryGhost#19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
  • Loading branch information
sagzy authored and aileen committed Mar 12, 2024
1 parent 7abaed0 commit 850385c
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -62,7 +62,7 @@ module.exports = async (model, frame, options = {}) => {
jsonModel.tiers = tiersData || [];
}

if (jsonModel.visibility === 'paid' && jsonModel.tiers) {
if (['tiers', 'paid'].includes(jsonModel.visibility) && jsonModel.tiers) {
jsonModel.tiers = tiersData ? tiersData.filter(t => t.type === 'paid') : [];
}

Expand Down

0 comments on commit 850385c

Please sign in to comment.