Open maclordaj opened 2 months ago
The change mentioned in the issue indeed seems to be the cause of the issue. This breaks the "from-to" detection of the following code. I think the line "$field_value = $timedate->to_db_date($field_value, false);" should be moved to row 1170, just before "$dates = $timedate->getDayStartEndGMT($field_value);".
Issue
I applied the current 7.14.3 update and have also tested on a new installation. Since at least this update when we set a list search filter (either advanced or basic) using the Date Entered or Date Modified fields, the results won't be correct. I've pinpointed the cause to a code change in the ./include/SearchForm/SearchForm2.php file related to this commit: https://github.com/serhiisamko091184/SuiteCRM/commit/a24b68d85d2e2a312b849d63c1a9e0a8dbe0709e
If we comment that line again the filters work as expected.
Expected Behavior
When using a date entered or modified filter, the results should be filtered by that date. e.g. I use the calendar to choose yesterday's (or tomorrow's) date for the date created field, so it shouldn't show records created today.
Actual Behavior
Today's records are shown.
Possible Fix
Deleting the line from this commit fixes that issue, but indeed the underlying issue that the commit was trying to fix won't work again. The commit doesn't explain why to fix one module this line is added without affecting other modules. Although I believe it has more to do with the way the date is changed between choosing it in the calendar and how the data in the backend is processed. I added a custom date field (without range) and it seems to work. It remains unknown to me if this affects custom date filters with range enabled. Filtering using the included expected closing date for the opportunity field seems to also work in a new install.
Steps to Reproduce
Context
Since I was able to reproduce using a new install and this is a default and very common field to use, I believe it might be a high priority bug. I have commented the line directly on the core file for now as a tentative workaround.
Your Environment