FOUR-16161: Add support for raw query conditions to advanced filters #6876
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.
Issue
Advanced Filters need to be able to support
raw()
filtering query conditions to allow for more granular filtering, e.g.raw(NOW() + 1 INTERVAL DAY)
which can be used to query tasks which will expire in the next 24 hours (but is not limited to just that, of course).Reproduction Steps
/tasks
pageraw()
, for example:raw(1 + 10)
. This is the one I used since SQL can do basic arithmetic and is useful to test against the integer value of the "Case Number" column.Testing in Tinker
You can also test more granularly by opening tinker (
php artisan tinker
) and creating a newProcessMaker\Filters\Filter
instance.Here is some example code you can use, but you can do much more than this if you'd like:
Solution
ProcessMaker\Traits\InteractsWithRawFilter
trait to contain the logic/query updatesProcessMaker\Filters\Filter
to check for and appropriately implement anyraw()
filter values foundHow to Test
All of the reproduction steps (for the UI and for tinker) would be best.
CICD
ci:next
Related Tickets & Packages
Code Review Checklist