Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1046647
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
Sun, Jun 29, 2:25 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Mon, Jun 30, 2:25 AM (10 h, 5 m)
Engine
blob
Format
Raw Data
Handle
676661
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