CRM-10016 admin renewal with membership type change does not respect selected record

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.1.2
    • Component/s: CiviMember
    • Labels:
      None

      Description

      if a contact has multiple membership records and you initiate a renewal from the admin side, and then change the membership type, the first current membership record in the listing is changed – not the record for which you actually initiated the renewal. this is because we are unsetting the membership record ID if the membership type changes, and we shouldn't.

      to reproduce:

      1) create two membership records with different membership types for a contact
      2) for the second record, click more > renew
      3) change the membership type to a different type
      4) notice that the first membership record was renewed – not the record you initiated the renewal for

      see attached patch for the fix.

        Attachments

          Activity

          [CRM-10016] admin renewal with membership type change does not respect selected record
          Deepak Srivastava added a comment -

          This is a valid behaviour if the two different membership types belong to same Organization. i.e the renew may end up upselling existing membership type from same org.

          I also tried with membership type that belongs to a different org, and it works fine by creating a new membership type.

          The behaviour is related to http://issues.civicrm.org/jira/browse/CRM-8141 feature.

          Brian, could you confirm if above is what's happening for you. Or i'm missing something ?

          Brian Shaughnessy added a comment -

          that's beside the point. the problem is that if I select membership record A (not type – but an actual record), renew it and change the membership type, then that record should be changed. it shouldn't matter whether the member org is changing or not. the point is that I selected a specific record to change and after completing the renewal, a different record was changed.

          David Greenberg added a comment -

          If an admin is doing the renewal in the backend, I agree with Brian that we should renew the selected membership regardless of any change to membership type organization. If the admin wants the "new membership" behavior, they can do that explicitly.

          Deepak Srivastava added a comment -

          Assigning to dave to decide on possible best solution here, as brian's comment / fix is in conflict with upsell feature.

          Brian Shaughnessy added a comment -

          I'm uncertain the purpose of the whereAdd() clause. But agree the edit memberships perms is a good way to condition this.

          Deepak Srivastava added a comment -

          Just for information - whereAdd() clause here is resetting the where clause completely, so a dao->find() later finds the same membership, which otherwise would not work if membership A (renewed from) and B(renewed to) belong to different org.

            People

            • Assignee:
              Brian Shaughnessy
              Reporter:
              Brian Shaughnessy

              Dates

              • Created:
                Updated:
                Resolved: