Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1181806
D183.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, Oct 14, 4:15 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Wed, Oct 15, 4:15 AM (9 h, 10 m)
Engine
blob
Format
Raw Data
Handle
767296
Attached To
D183: MINC-138 - Update Order user via "OrdersItem" object on the user login/registration page
D183.diff
View Options
Index: branches/5.2.x/units/orders/orders_event_handler.php
===================================================================
--- branches/5.2.x/units/orders/orders_event_handler.php
+++ branches/5.2.x/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