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

[4.x]: Cannot use [null, 1] value in "level" element query method if i querying for entries from channel sections #14419

Closed
piotrpog opened this issue Feb 17, 2024 · 2 comments

Comments

@piotrpog
Copy link

What happened?

Description

Recently when working on php module, i needed to query entries. I did not knew if element query would contain channel sections or structure sections, or mix of both (depends on user input). I wanted to query for all channel entries, or in case of structure, only for level 1 entries.

That's why i wanted to do something like this: ->level([null, 1]) - since level on channel entries equals null. This however returned zero entries, if queried for entries from channel sections. If i queried for entries from structure sections only, it worked fine.

Craft CMS version

4.7.2.1

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@brandonkelly
Copy link
Member

Just made this possible for Craft 4.8 (1140ea3).

To get on the 4.8 branch before it’s released, change your craftcms/cms requirement in composer.json to 4.8.x-dev as 4.8.0-alpha, and run composer update.

@brandonkelly
Copy link
Member

Craft 4.8.0 is tagged now, with that change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants