Index: branches/5.2.x/units/gateways/gw_classes/ideal_nl.php =================================================================== diff -u -N -r14258 -r14702 --- branches/5.2.x/units/gateways/gw_classes/ideal_nl.php (.../ideal_nl.php) (revision 14258) +++ branches/5.2.x/units/gateways/gw_classes/ideal_nl.php (.../ideal_nl.php) (revision 14702) @@ -1,6 +1,6 @@ Application->recallObject('CurlHelper'); /* @var $curl_helper kCurlHelper */ - + $banks = $curl_helper->Send($gw_params['request_url'].'?a=banklist'); $parser =& $this->Application->recallObject('kXMLHelper'); @@ -106,6 +106,8 @@ $this->parsed_responce['MESSAGE'] = $error_msg ? $error_msg : 'Unknown gateway error ('.htmlspecialchars($transaction_xml).')'; return false; } + + return true; } function getErrorMsg() Index: branches/5.2.x/units/product_options/product_options_helper.php =================================================================== diff -u -N -r14258 -r14702 --- branches/5.2.x/units/product_options/product_options_helper.php (.../product_options_helper.php) (revision 14258) +++ branches/5.2.x/units/product_options/product_options_helper.php (.../product_options_helper.php) (revision 14702) @@ -1,6 +1,6 @@ Conn->GetCol('SELECT ProductOptionId FROM '.TABLE_PREFIX.'ProductOptions WHERE ProductOptionId IN ('.join(',', $option_keys).') AND OptionType IN (1,3,6)'); + if ( !$option_keys ) { + return ''; + } + + $sql = 'SELECT ProductOptionId + FROM ' . TABLE_PREFIX . 'ProductOptions + WHERE ProductOptionId IN (' . join(',', $option_keys) . ') AND OptionType IN (1,3,6)'; + $included = $this->Conn->GetCol($sql); + foreach ($option_keys as $key) { - if (!in_array($key, $included)) { + if ( !in_array($key, $included) ) { unset($options[$key]); } } + return $this->OptionsSalt($options); } } \ No newline at end of file Index: branches/5.2.x/units/product_option_combinations/product_option_combinations_event_handler.php =================================================================== diff -u -N -r14625 -r14702 --- branches/5.2.x/units/product_option_combinations/product_option_combinations_event_handler.php (.../product_option_combinations_event_handler.php) (revision 14625) +++ branches/5.2.x/units/product_option_combinations/product_option_combinations_event_handler.php (.../product_option_combinations_event_handler.php) (revision 14702) @@ -1,6 +1,6 @@ Name) { case 'OnCreate': case 'OnUpdate': - $object =& $event->getObject(); - $options = unserialize($object->GetDBField('Combination')); - ksort($options); - $object->SetDBField('CombinationCRC', crc32(serialize($options))); + $object =& $event->getObject(); + /* @var $object kDBItem */ + + $options = unserialize($object->GetDBField('Combination')); + ksort($options); + $object->SetDBField('CombinationCRC', crc32(serialize($options))); break; case 'OnMassDelete': - // delete only option combinations that has no assiciated inventory + // delete only option combinations that has no associated inventory $object =& $event->getObject(); $ids = $event->getEventParam('ids'); $sql = 'SELECT '.$object->IDField.' @@ -254,7 +256,7 @@ /* @var $object kDBItem */ $id = $this->getPassedID($event); - + if ( !$id ) { $event->CallSubEvent('OnNew'); @@ -264,7 +266,7 @@ if ( $object->Load($id) ) { $actions =& $this->Application->recallObject('kActions'); /* @var $actions Params */ - + $actions->Set($event->getPrefixSpecial() . '_id', $object->GetId()); } } @@ -299,22 +301,26 @@ protected function OnBeforeClone(&$event) { parent::OnBeforeClone($event); - + $event->Init($event->Prefix, '-item'); + $object =& $event->getObject(); + /* @var $object kDBItem */ $options_mapping = $this->Application->GetVar('poc_mapping'); - if (!$options_mapping) return; + if ( !$options_mapping ) { + return; + } - foreach ($options_mapping as $original => $new) - { + foreach ($options_mapping as $original => $new) { + $n_combs = array (); $comb_data = unserialize($object->GetDBField('Combination')); - $n_combs = array(); - foreach ($comb_data as $key => $val) - { + + foreach ($comb_data as $key => $val) { $n_key = $key == $original ? $new : $key; $n_combs[$n_key] = $val; } + ksort($n_combs); $n_combs = serialize($n_combs); $n_crc = crc32($n_combs); Index: branches/5.2.x/units/orders/orders_event_handler.php =================================================================== diff -u -N -r14677 -r14702 --- branches/5.2.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 14677) +++ branches/5.2.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 14702) @@ -1,6 +1,6 @@ $payment_result, 'data'=>$gateway_object->parsed_responce, 'gw_data' => $gw_data, 'error_msg'=>$gateway_object->getErrorMsg()); } + /** + * Returns parameters, used to send order-related e-mails + * + * @param OrdersItem $order + * @return array + */ function OrderEmailParams(&$order) { $billing_email = $order->GetDBField('BillingEmail'); $user_email = $this->Conn->GetOne(' SELECT Email FROM '.$this->Application->getUnitOption('u', 'TableName').' WHERE PortalUserId = '.$order->GetDBField('PortalUserId')); $email_params = Array(); - $email_params['_user_email'] = $user_email; //for use when shipping vs user is required in InvetnoryAction + $email_params['_user_email'] = $user_email; //for use when shipping vs user is required in InventoryAction $email_params['to_email'] = $billing_email ? $billing_email : $user_email; $email_params['to_name'] = $order->GetDBField('BillingTo'); return $email_params; @@ -377,11 +383,15 @@ function OnCompleteOrder(&$event) { $this->LockTables($event); - if (!$this->CheckQuantites($event)) return; + if ( !$this->CheckQuantites($event) ) { + return; + } $this->ReserveItems($event); $order =& $event->getObject(); + /* @var $order OrdersItem */ + $charge_result = $this->ChargeOrder($order); if (!$charge_result['result']) { @@ -399,6 +409,8 @@ // call CompleteOrder events for items in order BEFORE SplitOrder (because ApproveEvents are called there) $order_items =& $this->Application->recallObject('orditems.-inv','orditems_List',Array('skip_counting'=>true,'per_page'=>-1) ); + /* @var $order_items kDBList */ + $order_items->linkToParent($order->Special); $order_items->Query(true); $order_items->GoFirst(); @@ -416,8 +428,8 @@ $this->PrepareCoupons($event, $order); } - $email_event_user =& $this->Application->EmailEventUser('ORDER.SUBMIT', $order->GetDBField('PortalUserId'), $this->OrderEmailParams($order)); - $email_event_admin =& $this->Application->EmailEventAdmin('ORDER.SUBMIT'); + $this->Application->EmailEventUser('ORDER.SUBMIT', $order->GetDBField('PortalUserId'), $this->OrderEmailParams($order)); + $this->Application->EmailEventAdmin('ORDER.SUBMIT'); } if ($shipping_control === false || $shipping_control == SHIPPING_CONTROL_PREAUTH ) { @@ -464,16 +476,24 @@ function setBillingAddress(&$event) { $object =& $event->getObject(); - if ($object->HasTangibleItems()) { - if ($this->Application->GetVar('same_address')) { + /* @var $object OrdersItem */ + + if ( $object->HasTangibleItems() ) { + if ( $this->Application->GetVar('same_address') ) { // copy shipping address to billing $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); list($id, $field_values) = each($items_info); - $address_fields = Array('To', 'Company', 'Phone', 'Fax', 'Email', 'Address1', 'Address2', 'City', 'State', 'Zip', 'Country'); + $address_fields = Array ( + 'To', 'Company', 'Phone', 'Fax', 'Email', + 'Address1', 'Address2', 'City', 'State', + 'Zip', 'Country' + ); + foreach ($address_fields as $address_field) { - $items_info[$id]['Billing'.$address_field] = $object->GetDBField('Shipping'.$address_field); + $items_info[$id]['Billing' . $address_field] = $object->GetDBField('Shipping' . $address_field); } + $this->Application->SetVar($event->getPrefixSpecial(true), $items_info); } } @@ -563,20 +583,22 @@ */ function OnProceedToBilling(&$event) { - $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); - if ($items_info) { + $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); + if ( $items_info ) { list($id, $field_values) = each($items_info); $object =& $event->getObject(); + /* @var $object kDBItem */ + $payment_type_id = $object->GetDBField('PaymentType'); - if (!$payment_type_id) { + if ( !$payment_type_id ) { $default_type = $this->_getDefaultPaymentType(); - if ($default_type) { + if ( $default_type ) { $field_values['PaymentType'] = $default_type; $items_info[$id] = $field_values; - $this->Application->SetVar( $event->getPrefixSpecial(true), $items_info ); + $this->Application->SetVar($event->getPrefixSpecial(true), $items_info); } } } @@ -585,13 +607,21 @@ $event->redirect = $this->Application->GetVar('next_step_template'); } - function OnCancelRecurring(&$event) + /** + * Removes reoccurring mark from the order + * + * @param kEvent $event + * @return void + */ + protected function OnCancelRecurring(&$event) { - $order =& $event->GetObject(); + $order =& $event->getObject(); + /* @var $order OrdersItem */ + $order->SetDBField('IsRecurringBilling', 0); $order->Update(); - if ($this->Application->GetVar('cancelrecurring_ok_template')) - { + + if ( $this->Application->GetVar('cancelrecurring_ok_template') ) { $event->redirect = $this->Application->GetVar('cancelrecurring_ok_template'); } } @@ -653,35 +683,42 @@ */ function createMissingAddresses(&$event) { - if (!$this->Application->LoggedIn()) { - return false; + if ( !$this->Application->LoggedIn() ) { + return ; } $object =& $event->getObject(); - $addr_list =& $this->Application->recallObject('addr', 'addr_List', Array('per_page'=>-1, 'skip_counting'=>true) ); + $addr_list =& $this->Application->recallObject('addr', 'addr_List', Array ('per_page' => -1, 'skip_counting' => true)); + /* @var $addr_list kDBList */ + $addr_list->Query(); - $address_dummy =& $this->Application->recallObject('addr.-item', null, Array('skip_autoload' => true)); + $address_dummy =& $this->Application->recallObject('addr.-item', null, Array ('skip_autoload' => true)); + /* @var $address_dummy AddressesItem */ - $address_prefixes = Array('Billing', 'Shipping'); - $address_fields = Array('To','Company','Phone','Fax','Email','Address1','Address2','City','State','Zip','Country'); + $address_prefixes = Array ('Billing', 'Shipping'); + $address_fields = Array ( + 'To', 'Company', 'Phone', 'Fax', 'Email', 'Address1', + 'Address2', 'City', 'State', 'Zip', 'Country' + ); + foreach ($address_prefixes as $address_prefix) { - $address_id = $this->Application->GetVar(strtolower($address_prefix).'_address_id'); + $address_id = $this->Application->GetVar(strtolower($address_prefix) . '_address_id'); - if (!$this->Application->GetVar('check_'.strtolower($address_prefix).'_address')) { + if ( !$this->Application->GetVar('check_' . strtolower($address_prefix) . '_address') ) { // form type doesn't match check type, e.g. shipping check on billing form continue; } - if ($address_id > 0) { + if ( $address_id > 0 ) { $address_dummy->Load($address_id); } else { - $address_dummy->SetDBField('PortalUserId', $this->Application->RecallVar('user_id') ); + $address_dummy->SetDBField('PortalUserId', $this->Application->RecallVar('user_id')); } foreach ($address_fields as $address_field) { - $address_dummy->SetDBField($address_field, $object->GetDBField($address_prefix.$address_field)); + $address_dummy->SetDBField($address_field, $object->GetDBField($address_prefix . $address_field)); } $address_dummy->MarkAddress($address_prefix, false); @@ -690,10 +727,18 @@ } } - function OnUpdateCart(&$event) + /** + * Updates shopping cart content + * + * @param kEvent $event + * @return void + * @access protected + */ + protected function OnUpdateCart(&$event) { $this->Application->HandleEvent($items_event, 'orditems:OnUpdate'); - return $event->CallSubEvent('OnRecalculateItems'); + + $event->CallSubEvent('OnRecalculateItems'); } /** @@ -1406,12 +1451,13 @@ return; } - $order =& $event->GetObject(); + $order =& $event->getObject(); + /* @var $order OrdersItem */ $ses_user = $this->Application->RecallVar('user_id'); - if ($order->GetDBField('PortalUserId') != $ses_user) { - if ($ses_user == 0) { + if ( $order->GetDBField('PortalUserId') != $ses_user ) { + if ( $ses_user == 0 ) { $ses_user = USER_GUEST; } @@ -1835,7 +1881,10 @@ 'OnMassOrderProcess' => ORDER_STATUS_TOSHIP, 'OnOrderProcess' => ORDER_STATUS_TOSHIP, ); + $order_items =& $this->Application->recallObject('orditems.-inv','orditems_List',Array('skip_counting'=>true,'per_page'=>-1) ); + /* @var $order_items kDBList */ + $order_items->linkToParent('-inv'); $order_items->Query(); $order_items->GoFirst(); @@ -1878,6 +1927,7 @@ $this->Application->registerClass( $gw_data['ClassName'], GW_CLASS_PATH.'/'.$gw_data['ClassFile'] ); $gateway_object =& $this->Application->recallObject( $gw_data['ClassName'] ); + /* @var $gateway_object kGWBase */ $charge_result = $gateway_object->Charge($object->GetFieldValues(), $gw_data['gw_params']); $sql = 'UPDATE %s SET GWResult2 = %s WHERE %s = %s'; @@ -1887,6 +1937,8 @@ if ($charge_result) { $product_object =& $this->Application->recallObject('p', null, Array('skip_autoload' => true)); + /* @var $product_object ProductsItem */ + foreach ($order_items->Records as $product_item) { if (!$product_item['ProductId']) { // product may have been deleted @@ -3141,21 +3193,24 @@ { $id = array_shift( $this->StoreSelectedIDs($event) ); - $idfield = $this->Application->getUnitOption($event->Prefix,'IDField'); + $id_field = $this->Application->getUnitOption($event->Prefix,'IDField'); $table = $this->Application->getUnitOption($event->Prefix,'TableName'); $sql = 'SELECT Status FROM %s WHERE %s = %s'; - $order_status = $this->Conn->GetOne( sprintf($sql, $table, $idfield, $id) ); + $order_status = $this->Conn->GetOne( sprintf($sql, $table, $id_field, $id) ); $prefix_special = $event->Prefix.'.'.$this->getSpecialByType($order_status); $orders_list =& $this->Application->recallObject($prefix_special, $event->Prefix.'_List', Array('per_page'=>-1) ); + /* @var $orders_list kDBList */ + $orders_list->Query(); - foreach($orders_list->Records as $row_num => $record) - { - if( $record[$idfield] == $id ) break; + foreach ($orders_list->Records as $row_num => $record) { + if ( $record[$id_field] == $id ) { + break; + } } $per_page = $this->getPerPage( new kEvent($prefix_special.':OnDummy') ); @@ -3168,27 +3223,26 @@ /** * Reset's any selected order state to pending * - * @param unknown_type $event + * @param kEvent $event */ function OnResetToPending(&$event) { $object =& $event->getObject( Array('skip_autoload' => true) ); + /* @var $object kDBItem */ - $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); - if($items_info) - { - foreach($items_info as $id => $field_values) - { + $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); + + if ( $items_info ) { + foreach ($items_info as $id => $field_values) { $object->Load($id); $object->SetDBField('Status', ORDER_STATUS_PENDING); - if( $object->Update() ) - { - $event->status=kEvent::erSUCCESS; + + if ( $object->Update() ) { + $event->status = kEvent::erSUCCESS; } - else - { - $event->status=kEvent::erFAIL; - $event->redirect=false; + else { + $event->status = kEvent::erFAIL; + $event->redirect = false; break; } } @@ -3535,7 +3589,9 @@ } $object =& $event->getObject(); - if (!$object->isLoaded()) { + /* @var $object kDBItem */ + + if ( !$object->isLoaded() ) { return true; } Index: branches/5.2.x/units/shipping/shipping_event_handler.php =================================================================== diff -u -N -r14677 -r14702 --- branches/5.2.x/units/shipping/shipping_event_handler.php (.../shipping_event_handler.php) (revision 14677) +++ branches/5.2.x/units/shipping/shipping_event_handler.php (.../shipping_event_handler.php) (revision 14702) @@ -1,6 +1,6 @@ CallSubEvent(''); - - $zones_object =& $this->Application->recallObject('z'); $cost_object =& $this->Application->recallObject('sc'); - $object = $event->getObject(); + /* @var $cost_object kDBItem */ + $object =& $event->getObject(); + /* @var $object kDBItem */ + $operation = $this->Application->GetVar('operation'); $formatter =& $this->Application->recallObject('kFormatter'); + /* @var $formatter kFormatter */ + $modify_by = $formatter->TypeCast($this->Application->GetVar('modify_by'), array('type'=>'float')); $cost_type = $object->GetDBField('CostType'); $brackets = $this->Application->GetVar('br'); $zones = $this->Application->GetVar('z'); $conditions = Array(); + if( is_array($zones) ) { $conditions['zones'] = 'ZoneID IN ('.implode( ',', array_keys($zones) ).')'; } + if( is_array($brackets) ) { $conditions['brackets'] = 'BracketId IN ('.implode( ',', array_keys($brackets) ).')'; } + $conditions = implode(' OR ', $conditions); - if(!$conditions) - { + if ( !$conditions ) { $this->finalizePopup($event); - return false; + return ; } $sql = 'SELECT ShippingCostId FROM '.$cost_object->TableName.' WHERE '.$conditions; $res = $this->Conn->GetCol($sql); - switch($cost_type) - { + switch ( $cost_type ) { case 1: - $affected_fields = Array(0 => 'Flat'); + $affected_fields = Array (0 => 'Flat'); break; + case 2: - $affected_fields = Array(0 => 'PerUnit'); + $affected_fields = Array (0 => 'PerUnit'); break; + default: - $affected_fields = Array(0 => 'PerUnit', 1 => 'Flat'); + $affected_fields = Array (0 => 'PerUnit', 1 => 'Flat'); } - foreach($affected_fields as $field) - { - if($operation == '/' && $modify_by == 0) break; - $sql = 'UPDATE '.$cost_object->TableName.' - SET '.$field.'='.$field.$operation.$modify_by.' - WHERE ShippingCostId IN ('.implode(',', $res).') - AND NOT('.$field.' IS NULL) - AND '.$field.$operation.$modify_by.'>=0'; + + foreach ($affected_fields as $field) { + if ( $operation == '/' && $modify_by == 0 ) { + break; + } + + $sql = 'UPDATE ' . $cost_object->TableName . ' + SET ' . $field . '=' . $field . $operation . $modify_by . ' + WHERE ShippingCostId IN (' . implode(',', $res) . ') + AND NOT(' . $field . ' IS NULL) + AND ' . $field . $operation . $modify_by . '>=0'; $this->Conn->Query($sql); } Index: branches/5.2.x/units/currencies/currencies_event_handler.php =================================================================== diff -u -N -r14677 -r14702 --- branches/5.2.x/units/currencies/currencies_event_handler.php (.../currencies_event_handler.php) (revision 14677) +++ branches/5.2.x/units/currencies/currencies_event_handler.php (.../currencies_event_handler.php) (revision 14702) @@ -1,6 +1,6 @@ Application->GetVar('unused_ids')) - { - $sql = 'UPDATE '.$this->Application->getUnitOption($event->Prefix, 'TableName').' + $unused_ids = $this->Application->GetVar('unused_ids'); + + if ( $unused_ids ) { + $sql = 'UPDATE ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . ' SET Status = 0 - WHERE CurrencyId IN('.$unused_ids.') AND IsPrimary <> 1'; + WHERE CurrencyId IN(' . $unused_ids . ') AND IsPrimary <> 1'; $this->Conn->Query($sql); } } Index: branches/5.2.x/units/gateways/gw_event_handler.php =================================================================== diff -u -N -r14258 -r14702 --- branches/5.2.x/units/gateways/gw_event_handler.php (.../gw_event_handler.php) (revision 14258) +++ branches/5.2.x/units/gateways/gw_event_handler.php (.../gw_event_handler.php) (revision 14702) @@ -1,6 +1,6 @@ Application->isAdminUser) { - return ; + if ( !$this->Application->isAdminUser ) { + return; } - $fh = opendir(GW_CLASS_PATH); + $gateways = glob(GW_CLASS_PATH . DIRECTORY_SEPARATOR . '*.php'); - while( $entry=readdir($fh) ) - { - if ( !is_file(GW_CLASS_PATH.'/'.$entry) ) continue; - $pathinfo = pathinfo($entry); - if ( $pathinfo['extension'] != 'php') continue; + if ( !$gateways ) { + return; + } + foreach ($gateways as $gateway_file) { $class_name = false; - include_once(GW_CLASS_PATH.'/'.$entry); - if (!$class_name) continue; + include_once($gateway_file); + + if ( !$class_name ) { + continue; + } + $tmp = new $class_name(); + /* @var $tmp kGWBase */ + $tmp->Install(); } - } } \ No newline at end of file Index: branches/5.2.x/units/orders/order_validator.php =================================================================== diff -u -N -r14641 -r14702 --- branches/5.2.x/units/orders/order_validator.php (.../order_validator.php) (revision 14641) +++ branches/5.2.x/units/orders/order_validator.php (.../order_validator.php) (revision 14702) @@ -1,6 +1,6 @@ Application->recallObject('kProductOptionsHelper'); $parsed = $opt_helper->ExplodeOptionValues($object->GetFieldValues()); - if (!$parsed) return; + if ( !$parsed ) { + return ''; + } + $values = $parsed['Values']; $conv_prices = $parsed['Prices']; $conv_price_types = $parsed['PriceTypes']; Index: branches/5.2.x/units/orders/orders_tag_processor.php =================================================================== diff -u -N -r14641 -r14702 --- branches/5.2.x/units/orders/orders_tag_processor.php (.../orders_tag_processor.php) (revision 14641) +++ branches/5.2.x/units/orders/orders_tag_processor.php (.../orders_tag_processor.php) (revision 14702) @@ -1,6 +1,6 @@ Application->ParseBlock( array('name' => $element), 1 ); + foreach ($totals as $type) { + $element = getArrayValue($params, $type . '_render_as'); + + if ( $element ) { + $o .= $this->Application->ParseBlock(array ('name' => $element), 1); } } + return $o; } Index: branches/5.2.x/units/currencies/currencies_tag_processor.php =================================================================== diff -u -N -r14258 -r14702 --- branches/5.2.x/units/currencies/currencies_tag_processor.php (.../currencies_tag_processor.php) (revision 14258) +++ branches/5.2.x/units/currencies/currencies_tag_processor.php (.../currencies_tag_processor.php) (revision 14702) @@ -1,6 +1,6 @@ Application->RemoveVar('saved_curr_ids'); } - if($unused_ids) - { + if ( $unused_ids ) { $this->Application->SetVar('unused_ids', $unused_ids); - $sql = 'SELECT ISO FROM '.$this->Application->getUnitOption($this->Prefix, 'TableName').' WHERE CurrencyId IN('.$unused_ids.') AND Status = 1'; - if($params['unused_iso'] = implode(', ', $this->Conn->GetCol($sql))) - { + $sql = 'SELECT ISO + FROM '.$this->Application->getUnitOption($this->Prefix, 'TableName').' + WHERE CurrencyId IN('.$unused_ids.') AND Status = 1'; + $params['unused_iso'] = implode(', ', $this->Conn->GetCol($sql)); + + if ( $params['unused_iso'] ) { $params['unused_ids'] = $unused_ids; $params['name'] = $params['block']; $ret = $this->Application->ParseBlock($params); Index: branches/5.2.x/units/products/products_tag_processor.php =================================================================== diff -u -N -r14258 -r14702 --- branches/5.2.x/units/products/products_tag_processor.php (.../products_tag_processor.php) (revision 14258) +++ branches/5.2.x/units/products/products_tag_processor.php (.../products_tag_processor.php) (revision 14702) @@ -1,6 +1,6 @@ SelectParam($params, 'add_to_wish_list_render_as,block_add_to_wish_list'); $params['block_remove_favorite'] = $this->SelectParam($params, 'remove_from_wish_list_render_as,block_remove_from_wish_list'); + return $this->FavoriteToggle($params); } Index: branches/5.2.x/units/affiliate_payments/affiliate_payments_tag_processor.php =================================================================== diff -u -N -r14258 -r14702 --- branches/5.2.x/units/affiliate_payments/affiliate_payments_tag_processor.php (.../affiliate_payments_tag_processor.php) (revision 14258) +++ branches/5.2.x/units/affiliate_payments/affiliate_payments_tag_processor.php (.../affiliate_payments_tag_processor.php) (revision 14702) @@ -1,6 +1,6 @@ getObject($params); $user_id = $object->GetDBField('PortalUserId'); - if ($user_id) { - $url_params = Array ( - 'm_opener' => 'd', - 'u_mode' => 't', - 'u_event' => 'OnEdit', - 'u_id' => $user_id, - 'pass' => 'all,u' - ); - - return $this->Application->HREF($params['edit_template'], '', $url_params); + if (!$user_id) { + return ''; } + + $url_params = Array ( + 'm_opener' => 'd', + 'u_mode' => 't', + 'u_event' => 'OnEdit', + 'u_id' => $user_id, + 'pass' => 'all,u' + ); + + return $this->Application->HREF($params['edit_template'], '', $url_params); } function ListPayments($params)