diff --git a/CRM/Booking/Form/AddSubResource.php b/CRM/Booking/Form/AddSubResource.php index cb008cb8..dcbd7904 100644 --- a/CRM/Booking/Form/AddSubResource.php +++ b/CRM/Booking/Form/AddSubResource.php @@ -61,6 +61,7 @@ function preProcess(){ while ($bao->fetch()) { $items[$bao->id] = array(); CRM_Core_DAO::storeValues($bao, $items[$bao->id]); + $items[$bao->id]['name'] = preg_replace('/[^\p{L}\p{N}\s]/u', '_', $items[$bao->id]['name']); } $days = CRM_Booking_Utils_DateTime::getDays(); @@ -166,7 +167,7 @@ function setDefaultValues() { $subResources['adhoc_charges'] = $addhocCharges; $total = ($subTotal - $this->_discountAmount) + $addhocCharges['total']; $subResources['total_price'] = $total; - // force JSON to encode empty array as object if there is empty array in $subResources + // force JSON to encode empty array as object if there is empty array in $subResources $defaults['sub_resources'] = json_encode($subResources,JSON_FORCE_OBJECT); $defaults['sub_total'] = $subTotal; $defaults['adhoc_charge'] = $addhocCharges['total'];