Allow DCA filter definitions without placeholder values #1257
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In a project of ours we dynamically injected a DCA filter into
via an
onload_callback
. However, in our case we wanted to add a query like this:foo NOT IN (…)
Initially we added the filter like this:
However, since Contao assumes that these filters are always a placeholder/value pair, the placeholders and values will mismatch in the final query and thus it results in a wrong SQL query, when user defined filter is selected for example.
As a workaround we implemented it like this:
so that there is no placeholder/value mismatch anymore. But it would be convenient (and would save some debugging time …) if one could simply define a filter without a placeholder like this:
This PR would allow that.