I'm trying to pull a set of 3 random entries from a Section. The entries need to have a certain Assets field not empty, and I also have to exclude entries already pulled (these entries are stored in the variable entriesA
).
The issue is that with my current query, the ID exclusion doesn't work – i.e. I'm getting back entries found in entriesA
.
Here's how the query looks:
{% set entriesB = craft.entries({
section : 'someSection',
assetsField : ':notempty:',
limit : 3,
order : 'RAND()',
id : 'and, not ' ~ entriesA.ids()|join(', not ')
}) %}
The problem appears to be the assetsField : ':notempty:'
statement – when I remove that, I get no duplicates. When it's included, Craft appears to ignore the id
parameter and I get back duplicates.
Anyone know what's up? Is it not possible to query using :notempty:
statements and id
?