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

REGRESSION: Relative date ranges no longer working in Smart Group criteria

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Blocker
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.1
    • Fix Version/s: 4.7.13
    • Component/s: None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Core Team Funds

      Description

      Right now in civicrm 4.7.x we are not storing the relative date value (e.g. 'this.year') but the absolute date range (from/to) values instead. As result it contradicts with smart group criteria for future purpose.
      Lemme explain the scenario with an example. Suppose you have created a smart group criteria where 'contribution.recieve_date = this.year' then currently we are storing the date range value as array(from => '01-01-2016', to => '31-12-2016'). As a result of which in near future say next year 2017 when we want to get the contributors in current year 2017 will always get the contributors of past year as per the store date range criteria of smart group, which is incorrect.
      For further details https://issues.civicrm.org/jira/browse/CRM-19250?focusedCommentId=94319&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-94319

      So we need to :
      1. Store relative date value in smart group's criteria NOT absolute date range.
      2. Handle the logic to retrieve the relative value and set as default value against desired entity date field on Smart Group criteria edit screen.

        Attachments

        1. contributions.PNG
          129 kB
          Joanne Chester
        2. NewRelativeDateSmartGroups.PNG
          95 kB
          Joanne Chester
        3. Screen Shot 2016-09-23 at 6.30.58 PM.png
          191 kB
          Monish Deb
        4. Screen Shot 2016-10-28 at 7.13.40 PM.png
          33 kB
          Monish Deb
        5. Screen Shot 2016-10-29 at 2.05.07 AM.png
          168 kB
          Monish Deb
        6. smartgroupEditScreen.png
          285 kB
          Monish Deb

          Issue Links

            Activity

              People

              • Assignee:
                monish.deb Monish Deb
                Reporter:
                monish.deb Monish Deb
              • Votes:
                1 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: