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
{{ message }}
Repository navigation
Multi-value filters (|| / &&) on content fields bind more parameters than the generated DQL declares #3808
Upgraded from Bolt 5.1.24. Same behaviour on a freshly cleared cache.
Description
A setcontent query that filters a content field with multiple values
(|| or &&) fails with:
Too many parameters: the query defines 3 parameters and you bound 4
The same syntax on a system field (e.g. status) works fine, so the
problem seems specific to how field filters are turned into DQL.
The number of declared parameters stays constant no matter how many values
are passed, while the number of bound parameters grows with each value. That
suggests the multi-value filter binds one parameter per value, but the DQL it
produces only ever contains a single placeholder for that field.
Expected: all of the above return records.
Actual: every multi-value filter on a content field throws.
Notes
Reproduced through Bolt\Storage\Query::getContent() directly, so it is not
template-specific.
Ruled out a project-level decorator of Bolt\Storage\Directive\OrderDirective
— the failure is identical with the decorator removed, and with no ordering
in the query at all.
Bolt\Storage\QueryParameterParser::multipleValueHandler() builds one
placeholder per value and calls $filter->setParameters() with all of them,
so the mismatch most likely appears further down, where the field filter is
joined onto the query. I have not traced it past that point.
Workarounds used
Two separate setcontent queries merged in Twig.
Where the field has a small closed set of values, negation of the complement
('!en' instead of 'hr || hren') — single parameter, works.
Activity
bobvandevijver commentedon Sep 23, 2026
Thank you for the report! Would be great if you can create a PR to fix this!
matesko commentedon Sep 23, 2026
PR submitted