Recurring Contributions: Custom field of type Date Date Select is ignored during searches
Overview
Custom fields of type Date applied to Recurring Contributions are ignored in at least Contact Advanced Searches. The search returns results as if the custom date field in question is left empty entirely.
https://chat.civicrm.org/civicrm/pl/pde69cq1stfdpg6oesi4jzihir
Reproduction steps
- Click on Administer-> Customize Data and Screens -> Custom Fields
- Click on Add set of Custom Fields
- Enter a Set Name, set Used for to Recurring Contributions, and click Save.
- Add a Field label, Set Data and Input Field Type to Date, set Date Format to mm/dd/yy, Is this Field Searchable? : Yes, and click Save.
- Create a recurring contribution (e.g. on dmaster: https://dmaster.demo.civicrm.org/sites/all/modules/civicrm/extern/rest.php?entity=ContributionRecur&action=create&api_key=userkey&key=sitekey&json={"contact_id":203,"amount":5,"frequency_interval":1,"frequency_unit":"month","is_test":1,"contribution_status_id":"In Progress"})
- Find the contact for whom the recurring contribution was created, click on Contributions then Recurring Contributions, then edit next to the one you created.
- Fill in 07/02/20 for your custom date field.
- Click on Search -> Advanced Search
- Click on Contributions -> Recurring Contributions -> All Recurring Contributions, click Search. You will get your user
- Click Edit Search Criteria -> in your custom date field, set Today, click Search.
You will still get your search result, even though you filtered by a date that should not have matched.
Current behaviour
You will still get your search result, even though you filtered by a date that should not have matched.
Expected behaviour
You should get 0 search results (if the above scenario was followed exactly), because your search filter should have excluded all records.
Environment information
- Browser: Firefox Quantum 68.10.0esr
- CiviCRM: 5.29.alpha1(dmaster)/5.26.2
- PHP: dmaster/7.4_
- CMS: Drupal (dmaster)/Drupal 7.72
- Database: dmaster/Ver 15.1 Distrib 10.1.45-MariaDB, for Linux (x86_64) using readline 5.1
- Web Server: dmaster/Nginx 1.19
Comments
This is the first time I've reported an issue — apologies if I missed anything!
Let me know if there is anyway I can help.
Best wishes,
Alex