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

Only return visible elements from Elements nested_elements relation #1589

Merged

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Jun 17, 2019

What is this pull request for?

Only return visible elements from Elements nested_elements relation.
Before we only return not trashed elements, but as discussed in #1587 is is very confusing to have hidden elements returned as well.

Closes #1587

Notable changes

This now always return not-trashed and visible elements from element.nested_elements calls. If - for any reason - you want to have all elements (even trashed and invisible elements) you have to use the newly introduced all_nested_elements relation.

tvdeyen added 3 commits June 17, 2019 21:18
We have scopes on the element.nested_elements relation that
makes it impossible to get all nested elements from an element.
We already excluded trashed elements from element.nested_elements
relation. We should not include hidden elements as well.

Closes AlchemyCMS#1587
The available scope is now the default scope for Elements nested_elements
relation.
@tvdeyen tvdeyen added this to the 4.3 milestone Jun 17, 2019
@tvdeyen tvdeyen merged commit 965c1a5 into AlchemyCMS:master Jun 18, 2019
@tvdeyen tvdeyen deleted the 1587-nested-elements-always-available-only branch June 18, 2019 06:45
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.

Nested elements are rendered even if they are unpublished
1 participant