From: pratikshad Date: Fri, 2 Jan 2015 04:27:35 +0000 (+0530) Subject: CRM-15770 fixes issue of empty date processing into membership page for offline X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=35fa23f869c47d5a6032c62cf2f24b06f820e0ef;p=civicrm-core.git CRM-15770 fixes issue of empty date processing into membership page for offline ---------------------------------------- * CRM-15770: if $dateString is 'null' make no attempt to format it https://issues.civicrm.org/jira/browse/CRM-15770 --- diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index 2acf18d710..3f7ddfc4f7 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -1815,7 +1815,9 @@ WHERE id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )'; if (empty($lineItem)) { $form->assign('mem_start_date', CRM_Utils_Date::customFormat($membership->start_date, '%B %E%f, %Y')); - $form->assign('mem_end_date', CRM_Utils_Date::customFormat($membership->end_date, '%B %E%f, %Y')); + if (!CRM_Utils_System::isNull($membership->end_date)) { + $form->assign('mem_end_date', CRM_Utils_Date::customFormat($membership->end_date, '%B %E%f, %Y')); + } $form->assign('membership_name', CRM_Member_PseudoConstant::membershipType($membership->membership_type_id)); } diff --git a/CRM/Utils/Date.php b/CRM/Utils/Date.php index 41e03a1d47..92aaa5c0ae 100644 --- a/CRM/Utils/Date.php +++ b/CRM/Utils/Date.php @@ -342,7 +342,7 @@ class CRM_Utils_Date { } } - if ($dateString) { + if (!CRM_Utils_System::isNull($dateString)) { if (strpos($dateString, '-')) { $year = (int) substr($dateString, 0, 4); $month = (int) substr($dateString, 5, 2);