Skip to content
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

[5.x] Only apply the published filter when not in preview mode #11652

Open
wants to merge 5 commits into
base: 5.x
Choose a base branch
from

Conversation

TheBnl
Copy link

@TheBnl TheBnl commented Apr 2, 2025

Possible fix for issue #6134

Checks if we're in isLivePreview before appending $filters['status'] = 'published';
Works similar as the fix made for the REST API #10229

Copy link
Member

@duncanmcclean duncanmcclean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to add a test for this?

@TheBnl
Copy link
Author

TheBnl commented Apr 4, 2025

Sure, i'll setup a test for checking if draft entries are received with a token and omitted without a token. 👍

@TheBnl
Copy link
Author

TheBnl commented Apr 4, 2025

I've added the testcase. While running the test I also needed to fix a line where the filters would default to null when empty. This should actually default to an empty array, further down the line the array type is required. Because published was always filtered this was previously not an issue.

@TheBnl TheBnl requested a review from duncanmcclean April 4, 2025 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants