You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
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 equalsnull
. 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
The text was updated successfully, but these errors were encountered: