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

Fix removing inclusive filters in getCollection #3216

Merged
merged 1 commit into from
Feb 10, 2021

Conversation

newbthenewbd
Copy link
Contributor

In Grav 1.6.31, a collection like this:

items:
  - '@root.descendants'
filter:
  published: true
  non-published: true

...catches all pages, published or not. This is thanks to the removal of inclusive sets before they are parsed.

It seems that sometime during the refactoring done in Grav 1.7, this removal of inclusive sets had gone missing. As a result, a collection like above first filters out non-published pages, then the published ones, and ends up empty. This pull request aims to fix that.

Bottom line, I think that this issue deserves a fairly high-priority fixing, as I'd imagine that this isn't the only workflow around that it is capable of breaking...

Thank You!

@rhukster rhukster requested a review from mahagr February 10, 2021 04:14
@mahagr
Copy link
Member

mahagr commented Feb 10, 2021

The new filters work as: published: true (all published), published: false (all unpublished), and published: null (ignore state).

So basically I wanted to get rid of the non- versions of the variables as they needlessly complicate the logic. I will accept the fix as I didn't mean to break existing behavior, but I will need to update it to work with the false value.

@mahagr mahagr merged commit 45cea4f into getgrav:develop Feb 10, 2021
mahagr added a commit that referenced this pull request Feb 10, 2021
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