X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FBAO%2FManagePremiums.php;h=8373b2971364c96a349ad285f38d4931125dd39c;hb=2ddf4544e42a25a923cb3183dcd4f865eaf02958;hp=40de859a9af231a18d8c4ce4f844b18a9efbb418;hpb=6c094ca6503eaf7f88650101f850a36bb1749cb2;p=civicrm-core.git diff --git a/CRM/Contribute/BAO/ManagePremiums.php b/CRM/Contribute/BAO/ManagePremiums.php index 40de859a9a..8373b29713 100644 --- a/CRM/Contribute/BAO/ManagePremiums.php +++ b/CRM/Contribute/BAO/ManagePremiums.php @@ -96,17 +96,17 @@ class CRM_Contribute_BAO_ManagePremiums extends CRM_Contribute_DAO_Product { * @return CRM_Contribute_DAO_Product */ public static function add(&$params, &$ids) { - $defaults = array( + $params = array_merge(array( 'id' => CRM_Utils_Array::value('premium', $ids), 'image' => '', 'thumbnail' => '', - 'is_active' => FALSE, + 'is_active' => 0, 'is_deductible' => FALSE, 'currency' => CRM_Core_Config::singleton()->defaultCurrency, - ); - $params = array_merge($defaults, $params); + ), $params); - // Use local URLs for images when possible + // Modify the submitted values for 'image' and 'thumbnail' so that we use + // local URLs for these images when possible. $params['image'] = CRM_Utils_String::simplifyURL($params['image'], TRUE); $params['thumbnail'] = CRM_Utils_String::simplifyURL($params['thumbnail'], TRUE);