Skip to content

Commit

Permalink
additional fix
Browse files Browse the repository at this point in the history
  • Loading branch information
monishdeb committed Jul 24, 2017
1 parent e0d4afb commit 312c781
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions CRM/Contribute/BAO/ManagePremiums.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,14 @@ public static function setIsActive($id, $is_active) {
* @return CRM_Contribute_DAO_Product
*/
public static function add(&$params, &$ids) {
$defaults = array(
$params = array_merge($params, array(
'id' => CRM_Utils_Array::value('premium', $ids),
'image' => '',
'thumbnail' => '',
'image' => CRM_Utils_String::simplifyURL(CRM_Utils_Array::value('image', $params, ''), TRUE),
'thumbnail' => CRM_Utils_String::simplifyURL(CRM_Utils_Array::value('thumbnail', $params, ''), TRUE),
'is_active' => FALSE,
'is_deductible' => FALSE,
'currency' => CRM_Core_Config::singleton()->defaultCurrency,
);
$params = array_merge($defaults, $params);

// Use local URLs for images when possible
$params['image'] = CRM_Utils_String::simplifyURL($params['image'], TRUE);
$params['thumbnail'] = CRM_Utils_String::simplifyURL($params['thumbnail'], TRUE);
));

// Save and return
$premium = new CRM_Contribute_DAO_Product();
Expand Down

0 comments on commit 312c781

Please sign in to comment.