Skip to content

Commit

Permalink
🐛 Fixed free tier showing in the tiers-only paywall in posts (#19807)
Browse files Browse the repository at this point in the history
refs INC-36
fixes #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 royalfig committed Mar 25, 2024
1 parent 45ab3d3 commit bbf438c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
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 bbf438c

Please sign in to comment.