Merge pull request #22438 from eileenmcnaughton/format
[civicrm-core.git] / CRM / Member / Page / AJAX.php
index ce7ecd79ba50b32994f627c42dfa85b4a1d90020..f76f9dddbc77c7d5322bb41915090152a2485be2 100644 (file)
@@ -46,9 +46,9 @@ WHERE   id = %1";
     }
     $details['total_amount_numeric'] = $details['total_amount'];
     // fix the display of the monetary value, CRM-4038
-    $details['total_amount'] = CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($details['total_amount']);
+    $details['total_amount'] = CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($details['total_amount'] ?? 0);
     $options = CRM_Core_SelectValues::memberAutoRenew();
-    $details['auto_renew'] = $options[$details]['auto_renew'] ?? NULL;
+    $details['auto_renew'] = $options[$details['auto_renew']] ?? NULL;
     CRM_Utils_JSON::output($details);
   }