Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-423

Advanced search using date field in custom data does not filter users in search results when different date settings are used (All users are returned)

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.2
    • Labels:
      None

      Description

      I am trying to simulate a customer's request to be able to see a list of new volunteers by date. In order to do this I created a Custom Data Group for volunteers and added a custom date field to the group that shows the date the user 1st signed up for an event and joined the team, etc.. After doing this, if you sign up users with different dates (9/22, 9/23, 9/24, 9/25, etc..) - then do an advanced search on the group - you would expect to return only the users whose volunteer dates matches the advanced search critera. But instead all users in the group are being returned.

      Steps
      1. Create a CiviCRM Group: civicrm/group/add?reset=1
      2. Create a CiviCRM Profile: civicrm/admin/uf/group?reset=1
      3. Create a Custom Data Group: civicrm/admin/custom/group?action=add&reset=1
      4. Set Used For to "Individuals".
      5. Set Weight depending on how you weighted profile fields in the CiviCRM Profile. (this custom data group will get associated to the profile later)
      6. Save
      7. View and Edit Custom Fields
      8. New Custom Field
      9. In Field Label type "Join Date"
      10. For Data and Input Field Type select "Date"
      11. Set the weight to 0
      12. Check "Required" & "Is This Field Searchable"
      13. Save
      14. Go to CiviCRM Profile: civicrm/admin/uf/group?reset=1
      15. Select the profile you created in Step #2 and click View and Edit Fields.
      16. Add the Date Custom Data field you just created in Step #8 to the Profile.
      17. Associate the CiviCRM Group to the volunteer module: admin/settings/volunteer - Contact Settings - Add/Update contacts to CiviCRM group when volunteering:
      18. Associate the CiviCRM Profile to the volunteer module: admin/settings/volunteer - Contact Settings - CiviCRM profile form for volunteers:
      19. Create an event
      20. Volunteer for the event
      21. Enter today's date for Join Date.
      22. Log out
      23. Log in with 3 new users & repeat this: Enter today's date for Join Date for 1 of the users; For the other two enter tomorrow's date.
      24. Manage Groups: civicrm/group?reset=1
      25. Select the Group you created in Step #1 and click "Show Group Members" to verify that volunteering for the event added 4 users.
      26. Do an advanced search: civicrm/contact/search/advanced
      27. Check mark your group in the Group(s) box, Expand the custom data item to expose Join Date.
      28. Enter today's date and click Search.

      Results
      29. All 4 users will be returned in the search results.

      Expected Results
      29. Only users #1 & #2 who's join date = today's date should be returned in the search.

      Notes
      1. If you associate a Yes/No radio button custom data field to the Profiile instead and do a boolean (true/false) search, the correct values are returned.

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              Anonymous
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: