-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev/core#1297 If start/end date is empty, results are empty #15415
Conversation
(Standard links)
|
Currently(after this patch), if I select Thanks. |
I just realized that there appears to be another issue affecting this search: Relative dates are not being converted to absolute. The$ formvalue being sent to CRM/Contact/BAO/Query.php has Which means that regardless the relative date that you put, results are always the same. I suppose I would need to create a separate issue for that bug. |
@VangelisP I think if you can remove the complete for loop and replace it with the below code, you should get the date field working correctly on the aggregate search form
Can you update this PR if the above snippet works for you? Thanks. |
Hi @jitendrapurohit , I've used your code example and enriched it. Now it works with relative/absolute dates as also with specified times or even empty date filters as well. |
@VangelisP |
83a4a85
to
940b14a
Compare
@jitendrapurohit is this good to merge? |
940b14a
to
c4f0bf3
Compare
@eileenmcnaughton yes, I've re-tested the changes and this looks good to be merged. Thanks @VangelisP |
Merging based on @jitendrapurohit review @VangelisP Can you commit to re-testing this during the rc - there have been a few moving parts in 5.20 that touch on dates in searches & it would be good to get some final testing on it |
Sure @eileenmcnaughton |
As a follow-up as asked, @eileenmcnaughton I just re-did a test with 5.20.beta1 and this is working perfectly. |
@VangelisP - thanks! |
Overview
If user has selected the 'Choose date range' date filtering option and he/she doesn't populate the end date field, the end date value becomes 0 and not a valid MySQL date, thus returning 0 results.
Related issue: https://lab.civicrm.org/dev/core/issues/1297
Before
No results are coming back
After
Results are coming back
Technical Details
If end date is empty, the clause produces
contrib.receive_date <= '0'
Expected behaviour:
contrib.receive_date <= <current_date & time>
Similarly, if start date is empty, we need to have valid date format.
Comments