New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#get helper retrieve pages or posts correctly with tier restrictions #16250
Comments
That doesn't look right! A PR to fix this would be welcome 🙂 |
I'd like to help, but I find the Ghost core a bit difficult to navigate. Can you point me in the right direction to start bug hunting? |
Our bot has automatically marked this issue as stale because there has not been any activity here in some time. The issue will be closed soon if there are no further updates, however we ask that you do not post comments to keep the issue open if you are not actively working on a PR. We keep the issue list minimal so we can keep focus on the most pressing issues. Closed issues can always be reopened if a new contributor is found. Thank you for understanding 🙂 |
Upon debugging When we make the call from the template which @cathysarisky provided we see no information about the tier. So when we add
Now let's say we are adding tier information also in Here when we go to the actual page (not getting data using get helper) with a user who has access to the tier, the member object has a The next step can be
These changes will have an effect on other aspects of Ghost (which I don't have much info about), and will require some go-ahead to make them and create a PR. |
Our bot has automatically marked this issue as stale because there has not been any activity here in some time. The issue will be closed soon if there are no further updates, however we ask that you do not post comments to keep the issue open if you are not actively working on a PR. We keep the issue list minimal so we can keep focus on the most pressing issues. Closed issues can always be reopened if a new contributor is found. Thank you for understanding 🙂 |
Issue Summary
When I {{#get}} either pages or posts and attempt to loop over them with {{#foreach}}, if those pages/posts are restricted to a specific tier, I don't get any {{content}} except the public preview (if any), whether the user has access to those items or not.
Steps to Reproduce
Create one a tier (link to Stripe to make this possible). I tested in Stripe's test mode.
Create posts/pages that are restricted to only that tier. (I also created some free and "paid member" posts.)
Create a new page template that includes the following code:
Create a new page (public) that uses the template with code above.
For a public post, I get the content at the top and the "This content is free" message. For the paid post, I get the content at the top and the "This content is paid" message, if I'm logged in with a paid user. For a 'paid members' post viewed as free user, I see the "You can't read this" message, followed by any public preview and CTA for that post. That's all good.
However, when my loop goes over a post restricted to a specific tier, I get the "You can't read this" message, whether or not my test user has access. I get the public preview (if any), but I don't get the protected content, NOR do I get a CTA, nor does the "Filtered content for {{tier}} message show up." That's not the expected behavior. I'd expect to see the content if my test user is allowed to see that content when navigating to the post directly, or to see a CTA and the message about filtering if my user is not allowed to see that content.
Ghost Version
Ghost Pro
Node.js Version
Ghost Pro
How did you install Ghost?
Ghost Pro
Database type
MySQL 8
Browser & OS version
No response
Relevant log / error output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: