Answers.Body: <p>An interesting workaround is you can make a profile that includes the membership end date for bulk updating memberships, then edit the membership end date there, and save. It won't throw an error. Not sure what the unintended consequences may be.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-08T17:10:01.870Z
Answers.LastActivityDate: 2019-10-08T17:10:01.870Z
Answers.UserDisplayName: Zachary
Answers.Body: <p>You can probably still change it via the API - specify the new end date on the existing membership, but that may have unintended consequences.</p>
  
  <p>How did you do the refund?  What status is the contribution?  Maybe changing the end date should be part of the refund process.   </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-27T13:36:36.280Z
Answers.Text: Thanks Aidan. The card payments are made via SagePay and we make the refunds via SagePay. Unfortunately, this doesn't update CiviCRM directly so we need to edit the contribution and membership end date manually in CiviCRM.
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-27T13:43:35.150Z
Answers.Text: The contribution status would be 'completed' before the money is refunded.
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-27T13:44:45.760Z
Answers.Text: Using the API isn't ideal for us as it would be the membership team that do this and we don't really want to unleash them on the API!
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-27T13:34:44.913Z
Answers.LastActivityDate: 2019-06-27T13:34:44.913Z
Answers.UserDisplayName: Aidan
Answers.Body: <p>If you disable auto-renew on the membership record, this will allow you to edit the end date. Once you have changed the end date, if you then enable auto-renew again.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-16T10:30:45.643Z
Answers.Text: Thanks for the suggestion but unfortunately this isn't possible. There isn't an option to cancel the auto-renew on the membership.
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-20T17:07:38.770Z
Answers.Text: Even in cases where "Cancel auto-renew" does appear in the "Renew" menu, if one elects to cancel it, then there is no option to re-enable it again. user6930 can you clarify what you meant here?
Answers.UserDisplayName: Daniel Ando Scholnick
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-05T13:40:28.523Z
Answers.LastActivityDate: 2019-07-05T13:40:28.523Z
Answers.UserDisplayName: user6930
Answers.Body: <p>I've raised this as <a href="https://lab.civicrm.org/dev/core/issues/1126" rel="nofollow noreferrer">issue #1126</a> in GitLab. From the discussion, it appears that this was implemented as a 'feature' in the past but it is unclear why this was necessary. Hopefully this issue will be resolved at some point in the future but this may take some time as we need to ensure that it won't cause a regression for existing users.</p>
  
  <p>As a workaround in the meantime, this issue can be resolved by either by making some minor changes to a core file or creating an extension that undoes the core behaviour and makes the fields editable.</p>
  
  <p>The relevant core file is <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Member/Form/Membership.php" rel="nofollow noreferrer">CRM/Member/Form/Membership.php</a>. The class in this file checks to see if the membership is related to a recurring contribution. If so, it prevents users from editing certain fields by freezing them. To prevent this behaviour you can simply search for and comment out the lines with 'freeze' in them.</p>
  
  <p>These are the relevant lines:</p>
  
  <ul>
  <li><a href="https://github.com/civicrm/civicrm-core/blob/55a6d945eeb180a14f1e7936167bf4e9e2bf0f92/CRM/Member/Form/Membership.php#L217" rel="nofollow noreferrer">line 217</a>: <code>$this-&gt;entityFields['end_date']['is_freeze'] = TRUE;</code></li>
  <li><a href="https://github.com/civicrm/civicrm-core/blob/55a6d945eeb180a14f1e7936167bf4e9e2bf0f92/CRM/Member/Form/Membership.php#L584" rel="nofollow noreferrer">line 584</a>: <code>$sel-&gt;freeze();</code></li>
  <li><a href="https://github.com/civicrm/civicrm-core/blob/55a6d945eeb180a14f1e7936167bf4e9e2bf0f92/CRM/Member/Form/Membership.php#L611" rel="nofollow noreferrer">line 611</a>: <code>$statusOverride-&gt;freeze();</code></li>
  </ul>
  
  <p>Obviously, do some testing on a copy of your site before implementing this to make sure it doesn't cause any issues!</p>
  
  <h1>Update 19 October 2019</h1>
  
  <p>A fix has been merged into CiviCRM core (<a href="https://github.com/civicrm/civicrm-core/pull/15540" rel="nofollow noreferrer">PR #15540</a>) that fixes this issue for the end date field. This fix should be included in CiviCRM 5.20.</p>
  
  <p>A separate issue (<a href="https://lab.civicrm.org/dev/core/issues/1331" rel="nofollow noreferrer">#1331</a>) has been raised in Git Lab for the other fields that are also frozen (Membership Organisation, Membership Type, Membership Status).</p>
  
  <h1>Update 23 March 2020</h1>
  
  <p>A fix for the Membership Organisation, Membership Type and Membership Status has been merged into core (<a href="https://github.com/civicrm/civicrm-core/pull/16609" rel="nofollow noreferrer">PR #16609</a>). This fix should be included in CiviCRM 5.25</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-08T19:14:39.733Z
Answers.Text: An extension would be an awesome contribution, thanks for this. I used the answer in my above post to change hundreds of them, this would have been much sleeker.
Answers.UserDisplayName: Zachary
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-08T16:17:16.253Z
Answers.LastActivityDate: 2020-03-23T12:48:13.010Z
Answers.LastEditDate: 2020-03-23T12:48:13.010Z
Answers.UserDisplayName: William Mortada
Body: <p>I am working on a website that has the option for members to pay for membership by direct debit (via GoCardless). This is working fine but occasionally we have an issue where a member pays by direct debit and also by card. We refund the card payment to the member but the membership end date is incorrect and we are unable to edit it.</p>
  
  <p>The membership is annual so if a member signs up by both direct debit and card the two payments will add two years to the end date (e.g. it will be 2021 rather than 2020). So, after we refund the card payment we want to also edit the end date to change it to 2020. Unfortunately, we are unable to do this. </p>
  
  <p>Normally, you can edit the end date, as shown below:</p>
  
  <p><a href="https://i.sstatic.net/A5Ven.png" rel="noreferrer"><img src="https://i.sstatic.net/A5Ven.png" alt="enter image description here"></a></p>
  
  <p>It appears that if the membership is set as auto-renew and linked to a recurring payment then CiviCRM doesn't allow you to edit the end date. I presume this is a deliberate 'feature' but in our case it is preventing us from correcting the end date.</p>
  
  <p><a href="https://i.sstatic.net/kvEwI.png" rel="noreferrer"><img src="https://i.sstatic.net/kvEwI.png" alt="enter image description here"></a>
  How can we edit the end date in these circumstances?</p>
  
  <p>CiviCRM 5.7.6 on WordPress </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-08-19T19:45:32.223Z
Comments.Text: I am having the same issue in CiviCRM 5.13.6 on Drupal. This field used to be editable (with an appropriate caution that would appear), but it was changed to be view-only.  I wonder if there might be a simple code modification that could make it editable again?
Comments.UserDisplayName: Daniel Ando Scholnick
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-08-20T17:24:25.810Z
Comments.Text: Update: This has been reported as a bug at https://lab.civicrm.org/dev/core/issues/1126 - hopefully the restriction will be removed in coming updates.
Comments.UserDisplayName: Daniel Ando Scholnick
Tags: <civimember><recurring-contributions><auto-renew>
Title: How can you edit the end date for an auto-renew membership?
ThreadText: # How can you edit the end date for an auto-renew membership?
  
  (Asked by: username_0 on 2019-06-27)
  
  I am working on a website that has the option for members to pay for membership by direct debit (via GoCardless). This is working fine but occasionally we have an issue where a member pays by direct debit and also by card. We refund the card payment to the member but the membership end date is incorrect and we are unable to edit it.
  
  The membership is annual so if a member signs up by both direct debit and card the two payments will add two years to the end date (e.g. it will be 2021 rather than 2020). So, after we refund the card payment we want to also edit the end date to change it to 2020. Unfortunately, we are unable to do this.
  
  Normally, you can edit the end date, as shown below:
  
  [![enter image description here](https://i.sstatic.net/A5Ven.png)](https://i.sstatic.net/A5Ven.png)
  
  It appears that if the membership is set as auto-renew and linked to a recurring payment then CiviCRM doesn't allow you to edit the end date. I presume this is a deliberate 'feature' but in our case it is preventing us from correcting the end date.
  
  [![enter image description here](https://i.sstatic.net/kvEwI.png)](https://i.sstatic.net/kvEwI.png)
  How can we edit the end date in these circumstances?
  
  CiviCRM 5.7.6 on WordPress
  
  **Tags:** civimember, recurring-contributions, auto-renew
  
  > **Comments:**
  > **username_1**: I am having the same issue in CiviCRM 5.13.6 on Drupal. This field used to be editable (with an appropriate caution that would appear), but it was changed to be view-only.  I wonder if there might be a simple code modification that could make it editable again?  
  > **username_1**: Update: This has been reported as a bug at https://lab.civicrm.org/dev/core/issues/1126 - hopefully the restriction will be removed in coming updates.  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_0 on 2019-10-08. Score: 4 | Accepted answer
  
  I've raised this as [issue #1126](https://lab.civicrm.org/dev/core/issues/1126) in GitLab. From the discussion, it appears that this was implemented as a 'feature' in the past but it is unclear why this was necessary. Hopefully this issue will be resolved at some point in the future but this may take some time as we need to ensure that it won't cause a regression for existing users.
  
  As a workaround in the meantime, this issue can be resolved by either by making some minor changes to a core file or creating an extension that undoes the core behaviour and makes the fields editable.
  
  The relevant core file is [CRM/Member/Form/Membership.php](https://github.com/civicrm/civicrm-core/blob/master/CRM/Member/Form/Membership.php). The class in this file checks to see if the membership is related to a recurring contribution. If so, it prevents users from editing certain fields by freezing them. To prevent this behaviour you can simply search for and comment out the lines with 'freeze' in them.
  
  These are the relevant lines:
  
  * [line 217](https://github.com/civicrm/civicrm-core/blob/55a6d945eeb180a14f1e7936167bf4e9e2bf0f92/CRM/Member/Form/Membership.php#L217): `$this->entityFields['end_date']['is_freeze'] = TRUE;`
  * [line 584](https://github.com/civicrm/civicrm-core/blob/55a6d945eeb180a14f1e7936167bf4e9e2bf0f92/CRM/Member/Form/Membership.php#L584): `$sel->freeze();`
  * [line 611](https://github.com/civicrm/civicrm-core/blob/55a6d945eeb180a14f1e7936167bf4e9e2bf0f92/CRM/Member/Form/Membership.php#L611): `$statusOverride->freeze();`
  
  Obviously, do some testing on a copy of your site before implementing this to make sure it doesn't cause any issues!
  
  # Update 19 October 2019
  
  A fix has been merged into CiviCRM core ([PR #15540](https://github.com/civicrm/civicrm-core/pull/15540)) that fixes this issue for the end date field. This fix should be included in CiviCRM 5.20.
  
  A separate issue ([#1331](https://lab.civicrm.org/dev/core/issues/1331)) has been raised in Git Lab for the other fields that are also frozen (Membership Organisation, Membership Type, Membership Status).
  
  # Update 23 March 2020
  
  A fix for the Membership Organisation, Membership Type and Membership Status has been merged into core ([PR #16609](https://github.com/civicrm/civicrm-core/pull/16609)). This fix should be included in CiviCRM 5.25
  
  > **Comments:**
  > **username_2**: An extension would be an awesome contribution, thanks for this. I used the answer in my above post to change hundreds of them, this would have been much sleeker.  
  
  ---
  
  ### Answer by username_2 on 2019-10-08. Score: 2
  
  An interesting workaround is you can make a profile that includes the membership end date for bulk updating memberships, then edit the membership end date there, and save. It won't throw an error. Not sure what the unintended consequences may be.
  
  
  ---
  
  ### Answer by username_3 on 2019-06-27. Score: 1
  
  You can probably still change it via the API - specify the new end date on the existing membership, but that may have unintended consequences.
  
  How did you do the refund? What status is the contribution? Maybe changing the end date should be part of the refund process.
  
  > **Comments:**
  > **username_0**: Thanks username_3. The card payments are made via SagePay and we make the refunds via SagePay. Unfortunately, this doesn't update CiviCRM directly so we need to edit the contribution and membership end date manually in CiviCRM.  
  > **username_0**: The contribution status would be 'completed' before the money is refunded.  
  > **username_0**: Using the API isn't ideal for us as it would be the membership team that do this and we don't really want to unleash them on the API!  
  
  ---
  
  ### Answer by username_4 on 2019-07-05. Score: 0
  
  If you disable auto-renew on the membership record, this will allow you to edit the end date. Once you have changed the end date, if you then enable auto-renew again.
  
  > **Comments:**
  > **username_0**: Thanks for the suggestion but unfortunately this isn't possible. There isn't an option to cancel the auto-renew on the membership.  
  > **username_1**: Even in cases where "Cancel auto-renew" does appear in the "Renew" menu, if one elects to cancel it, then there is no option to re-enable it again. username_4 can you clarify what you meant here?  
  
  ---
  
  