Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1168443
D183.id434.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
Wed, Sep 24, 2:33 PM
Size
1 KB
Mime Type
text/x-diff
Expires
Thu, Sep 25, 2:33 PM (2 h, 8 m)
Engine
blob
Format
Raw Data
Handle
756939
Attached To
D183: MINC-138 - Update Order user via "OrdersItem" object on the user login/registration page
D183.id434.diff
View Options
Index: modules/in-commerce/units/orders/orders_event_handler.php
===================================================================
--- modules/in-commerce/units/orders/orders_event_handler.php
+++ modules/in-commerce/units/orders/orders_event_handler.php
@@ -318,16 +318,14 @@
$fields_hash['AffiliateId'] = $affiliate_id;
}
- $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
- $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
-
- $this->Conn->doUpdate($fields_hash, $table_name, $id_field . ' = ' . $order_id);
-
- $object = $event->getObject();
- /* @var $object kDBItem */
+ /** @var OrdersItem $object */
+ $object = $this->Application->recallObject($event->Prefix . '.-item', null, array('skip_autoload' => true));
+ $object->Load($order_id);
- // set user id to object, since it will be used during order update from OnRecalculateItems event
- $object->SetDBField('PortalUserId', $user->GetID());
+ if ( $object->isLoaded() ) {
+ $object->SetDBFieldsFromHash($fields_hash);
+ $object->Update();
+ }
}
function isAffiliate($user_id)
Event Timeline
Log In to Comment