* @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);