CRM-5552 New membership doesn't apply sensible defaults for start/end dates

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.2.9, 3.0, 3.0.1, 3.0.2, 3.0.3
    • Fix Version/s: 3.1
    • Component/s: CiviMember
    • Labels:
      None

      Description

      When a new membership is created by CRM_Member_Form_Membership, if the join date is specified, but not the start and end dates, then the membership fails with "There is no valid Membership Status available for selected membership dates." since the omitted start and end dates don't match any status. However if the start and end dates are provided, they are checked against the rules for the specified membership type. It would be more sensible to just default the start and end dates based on the rules for the specified membership type. Implementing this enhancement would be straightforward.

        Attachments

          Activity

          [CRM-5552] New membership doesn't apply sensible defaults for start/end dates
          David Greenberg added a comment -

          The behavior you're describing is not the expected behavior AND not the behavior I'm seeing on the 3.0 demo and my 3.1 sandbox (using the default status rules and sample membership types). When I go to New Membership and select a membership type and leave the other form defaults (Join Date = today, Start and End dates are empty) - I get a new membership created with Start Date = Today and End Date = today + membership period.

          http://drupal.demo.civicrm.org/civicrm/contact/view?reset=1&force=1&cid=112&selectedChild=member

          If you can recreate this on 3.0 demo, please include steps... or diagnose what's different about the flow / environment where you're getting this error.

          Dharmatech added a comment -

          Roger that. I went to drupal.demo.civicrm.org, clicked on jdoe@email.com, created a new membership Inner City Arts/Student with a join date of Dec 3, 2008 and left the start and end dates unspecified. By the membership status rules this should put the membership in the Grace state. However I got the "no valid status" error message.

          – Walt

          David Greenberg added a comment -

          Thanks for clarifying the steps (i.e overriding the default Join Date of today) which trigger the bug. Assigning to you to post test and patch per your conversation with Lobo.

          Dharmatech added a comment -

          Default start and end dates in CRM_Member_Form_Membership::formRule() if not supplied by the user. Added unit tests for that method to tests/phpunit.

          David Greenberg added a comment -

          Reopening and assigning to Piotr because it doesn't look like these changes made it into 3.1 branch.

            People

            • Assignee:
              David Greenberg
              Reporter:
              Dharmatech

              Dates

              • Created:
                Updated:
                Resolved: