Skip to content

Commit

Permalink
SUP-46300 Skip when 'null' is set as the end_date as this indicates a…
Browse files Browse the repository at this point in the history
… Lifetime membership term with on end date
  • Loading branch information
agileware-justin committed Jul 4, 2022
1 parent 3a5d82f commit d443c66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<url desc="Support">https://agileware.com.au/contact</url>
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2022-06-27</releaseDate>
<version>1.3.2</version>
<releaseDate>2022-07-04</releaseDate>
<version>1.3.3</version>
<develStage>beta</develStage>
<compatibility>
<ver>5.0</ver>
Expand Down
3 changes: 2 additions & 1 deletion membershiputils.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ function membershiputils_adjustmembershipenddate($end_date) {

function membershiputils_civicrm_pre($op, $objectName, $id, &$params) {
// If the Membership is being created or edited and the end date has been set then adjust
if (('Membership' == $objectName) && ('edit' == $op || 'create' == $op) && $params['end_date']) {
// Skip when 'null' is set as the end_date as this indicates a Lifetime membership term with on end date
if (('Membership' == $objectName) && ('edit' == $op || 'create' == $op) && $params['end_date'] && 'null' !== $params['end_date']) {
if (Civi::settings()->get('adjust_membership_end_date')) {
// This is where CiviCRM may pass in the end date in two different formats
$params['end_date'] = membershiputils_adjustmembershipenddate($params['end_date']);
Expand Down

0 comments on commit d443c66

Please sign in to comment.