From 52b04786d3d0bdd9e17ccf198c3d28b96b51cd8c Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 13 Mar 2020 15:03:08 +1300 Subject: [PATCH] dev/core#1630 Partial fix on renew membership missing I'm pretty comfortable that this regressed at least a year ago - possibly much longer - so it's not a recent regression. However, the issue is that when a price set is configured it is still 'listening to' the presence or otherwise of auto_renew in civicrm_membership_block.membership_types. This makes it ignore that if not present (which is the case when creating a new price set from scratch). When converting a price set the membership_types field is still populated and still kicks in - I think we should really empty that out when a block is converted but I've left it out of scope as this seems like an edge case bug & it was only the possibity it was a regression that caused me to dig into it --- CRM/Contribute/Form/ContributionBase.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index e3acbd7cb3..1b2b848b6c 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -1225,7 +1225,8 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { if ($allowAutoRenewOpt) { $javascriptMethod = ['onclick' => "return showHideAutoRenew( this.value );"]; - $autoRenewMembershipTypeOptions["autoRenewMembershipType_{$value}"] = (int) $memType['auto_renew'] * CRM_Utils_Array::value($value, CRM_Utils_Array::value('auto_renew', $this->_membershipBlock)); + $isAvailableAutoRenew = $this->_membershipBlock['auto_renew'][$value] ?? 1; + $autoRenewMembershipTypeOptions["autoRenewMembershipType_{$value}"] = (int) $memType['auto_renew'] * $isAvailableAutoRenew; $allowAutoRenewMembership = TRUE; } else { -- 2.25.1