Index: branches/5.2.x/install/upgrades.sql =================================================================== diff -u -N -r15123 -r15213 --- branches/5.2.x/install/upgrades.sql (.../upgrades.sql) (revision 15123) +++ branches/5.2.x/install/upgrades.sql (.../upgrades.sql) (revision 15213) @@ -263,3 +263,5 @@ # ===== v 5.2.0-B2 ===== UPDATE Products main_table SET main_table.CachedReviewsQty = (SELECT COUNT(*) FROM <%TABLE_PREFIX%>CatalogReviews review_table WHERE review_table.ItemId = main_table.ResourceId); + +# ===== v 5.2.0-B3 ===== Index: branches/5.2.x/units/orders/orders_event_handler.php =================================================================== diff -u -N -r15172 -r15213 --- branches/5.2.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 15172) +++ branches/5.2.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 15213) @@ -1,6 +1,6 @@ GetDBField('ShippingEmail'); $email_params['to_email'] = $shipping_email ? $shipping_email : $email_params['_user_email']; - $email_event_user =& $this->Application->EmailEventUser('ORDER.SHIP', $object->GetDBField('PortalUserId'), $email_params); + $this->Application->EmailEventUser('ORDER.SHIP', $object->GetDBField('PortalUserId'), $email_params); // inform payment gateway that order was shipped $gw_data = $object->getGatewayData(); @@ -2210,7 +2210,7 @@ if ($this->ReadyToProcess($object->GetID())) { $event->CallSubEvent('OnReserveItems'); if ($event->status == kEvent::erSUCCESS) $set_new_status = true; - $email_event_user =& $this->Application->EmailEventUser('BACKORDER.PROCESS', $object->GetDBField('PortalUserId'), $email_params); + $this->Application->EmailEventUser('BACKORDER.PROCESS', $object->GetDBField('PortalUserId'), $email_params); } else { $event->status = kEvent::erFAIL; } @@ -2872,8 +2872,8 @@ $sub_order->SetDBField('Status', ORDER_STATUS_BACKORDERS); if ($event->Special != 'recurring') { // just in case if admin uses tangible backordered products in recurring orders - $email_event_user =& $this->Application->EmailEventUser('BACKORDER.ADD', $sub_order->GetDBField('PortalUserId'), $this->OrderEmailParams($sub_order)); - $email_event_admin =& $this->Application->EmailEventAdmin('BACKORDER.ADD'); + $this->Application->EmailEventUser('BACKORDER.ADD', $sub_order->GetDBField('PortalUserId'), $this->OrderEmailParams($sub_order)); + $this->Application->EmailEventAdmin('BACKORDER.ADD'); } } else { @@ -3511,15 +3511,15 @@ if ($complete_event->status == kEvent::erSUCCESS) { //send recurring ok email - $email_event_user =& $this->Application->EmailEventUser('ORDER.RECURRING.PROCESSED', $order->GetDBField('PortalUserId'), $this->OrderEmailParams($order)); - $email_event_admin =& $this->Application->EmailEventAdmin('ORDER.RECURRING.PROCESSED'); + $this->Application->EmailEventUser('ORDER.RECURRING.PROCESSED', $order->GetDBField('PortalUserId'), $this->OrderEmailParams($order)); + $this->Application->EmailEventAdmin('ORDER.RECURRING.PROCESSED'); } else { //send Recurring failed event $order->SetDBField('Status', ORDER_STATUS_DENIED); $order->Update(); - $email_event_user =& $this->Application->EmailEventUser('ORDER.RECURRING.DENIED', $order->GetDBField('PortalUserId'), $this->OrderEmailParams($order)); - $email_event_admin =& $this->Application->EmailEventAdmin('ORDER.RECURRING.DENIED'); + $this->Application->EmailEventUser('ORDER.RECURRING.DENIED', $order->GetDBField('PortalUserId'), $this->OrderEmailParams($order)); + $this->Application->EmailEventAdmin('ORDER.RECURRING.DENIED'); } } Index: branches/5.2.x/units/products/products_event_handler.php =================================================================== diff -u -N -r15149 -r15213 --- branches/5.2.x/units/products/products_event_handler.php (.../products_event_handler.php) (revision 15149) +++ branches/5.2.x/units/products/products_event_handler.php (.../products_event_handler.php) (revision 15213) @@ -1,6 +1,6 @@ Load($ord_id); - $email_event_admin =& $this->Application->EmailEventAdmin('BACKORDER.FULLFILL'); + $this->Application->EmailEventAdmin('BACKORDER.FULLFILL'); //reserve what's possible in any case - $this->Application->HandleEvent( $event, 'ord:OnReserveItems' ); - if ($event->status == kEvent::erSUCCESS) { // + $event = new kEvent('ord:OnReserveItems'); + $this->Application->HandleEvent($event); + + if ( $event->status == kEvent::erSUCCESS ) { // //in case the order is ready to process - process it - $this->Application->HandleEvent( $event, 'ord:OnOrderProcess' ); + $this->Application->HandleEvent($event, 'ord:OnOrderProcess'); } } } @@ -769,13 +771,13 @@ $send_params['from_name']=$my_name; $send_params['message']=$my_message; - if (preg_match('/'.REGEX_EMAIL_USER.'@'.REGEX_EMAIL_DOMAIN.'/', $friend_email)) { + if ( preg_match('/' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . '/', $friend_email) ) { $user_id = $this->Application->RecallVar('user_id'); - $email_event = &$this->Application->EmailEventUser('PRODUCT.SUGGEST', $user_id, $send_params); - $email_event = &$this->Application->EmailEventAdmin('PRODUCT.SUGGEST'); + $email_sent = $this->Application->EmailEventUser('PRODUCT.SUGGEST', $user_id, $send_params); + $this->Application->EmailEventAdmin('PRODUCT.SUGGEST'); - if ($email_event->status == kEvent::erSUCCESS){ - $event->setRedirectParams(Array('opener' => 's', 'pass' => 'all')); + if ( $email_sent ) { + $event->setRedirectParams(Array ('opener' => 's', 'pass' => 'all')); $event->redirect = $this->Application->GetVar('template_success'); } else { @@ -785,11 +787,11 @@ $object->SetError('Email', 'send_error', 'lu_email_send_error'); $event->status = kEvent::erFAIL; } - } - else { + } + else { $object->SetError('Email', 'invalid_email', 'lu_InvalidEmail'); $event->status = kEvent::erFAIL; - } + } } /** Index: branches/5.2.x/install/upgrades.php =================================================================== diff -u -N -r15198 -r15213 --- branches/5.2.x/install/upgrades.php (.../upgrades.php) (revision 15198) +++ branches/5.2.x/install/upgrades.php (.../upgrades.php) (revision 15213) @@ -1,6 +1,6 @@ Array ('Core' => '5.1.3'), '5.2.0-B1' => Array ('Core' => '5.2.0-B1'), '5.2.0-B2' => Array ('Core' => '5.2.0-B2'), + '5.2.0-B3' => Array ('Core' => '5.2.0-B3'), ); }