Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F802818
D57.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Feb 25, 2:22 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Wed, Feb 26, 2:22 AM (18 h, 59 m)
Engine
blob
Format
Raw Data
Handle
575693
Attached To
D57: MINC-121 - Don't mix event variables during backorder fulfillment
D57.diff
View Options
Index: branches/5.2.x/units/products/products_event_handler.php
===================================================================
--- branches/5.2.x/units/products/products_event_handler.php
+++ branches/5.2.x/units/products/products_event_handler.php
@@ -291,21 +291,25 @@
$orders = $this->Conn->GetCol($query);
- if (!$orders) return;
+ if ( !$orders ) {
+ return;
+ }
+
+ /** @var OrdersItem $order */
+ $order = $this->Application->recallObject('ord.-inv', null, array('skip_autoload' => true));
- $order = $this->Application->recallObject('ord.-inv', null, Array('skip_autoload' => true));
foreach ($orders as $ord_id) {
$order->Load($ord_id);
$this->Application->emailAdmin('BACKORDER.FULLFILL');
- //reserve what's possible in any case
- $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');
+ // Reserve what's possible in any case.
+ $reserve_event = new kEvent('ord:OnReserveItems');
+ $this->Application->HandleEvent($reserve_event);
+
+ // In case the order is ready to process - process it.
+ if ( $reserve_event->status == kEvent::erSUCCESS ) {
+ $this->Application->HandleEvent(new kEvent('ord:OnOrderProcess'));
}
}
}
Event Timeline
Log In to Comment