includes/classes/order.php
generation of a database table id is not collected for potential use before initiating a notify action. lines 888-890.
Code:
zen_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
$this->notify('NOTIFY_ORDER_DURING_CREATE_ADDED_ATTRIBUTE_LINE_ITEM', $sql_data_array);
The $sql_data_array is added to the table Orders Products Attributes, but the position of that addition is not immediately captured and could be lost in the initiation of the notify.
Earlier in the code a similar addition is performed at lines 802-804:
Code:
zen_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
$order_products_id = $db->Insert_ID();
$this->notify('NOTIFY_ORDER_DURING_CREATE_ADDED_PRODUCT_LINE_ITEM', array_merge(array('orders_products_id' => $order_products_id), $sql_data_array));
suggest the same type of designation and assignment:
Code:
zen_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
$order_products_attributes_id = $db->Insert_ID();
$this->notify('NOTIFY_ORDER_DURING_CREATE_ADDED_ATTRIBUTE_LINE_ITEM', array_merge(array('orders_products_attributes_id' => $order_products_attributes_id), $sql_data_array));
It would seem that though the additional assignment would not be necessary for discovery of the same information in the table (ie. the database table can be searched for successful addition of the $sql_data_array), it is inconsistent with the guidelines and suggestions of the forum for design by NOT collecting the insertion id before performing an action against the $db variable/the database table before collecting that new number and is inconsistent with code a few lines back...
FWIW, this was also posted previously as a code suggestion.
Bookmarks