diff --git a/modules/cart/commerce_cart.module b/modules/cart/commerce_cart.module index 7b479f5..22073a6 100644 --- a/modules/cart/commerce_cart.module +++ b/modules/cart/commerce_cart.module @@ -74,7 +74,7 @@ function commerce_cart_menu_item_title() { $title = t('Shopping cart'); // If the user actually has a cart order... - if ($order = commerce_cart_order_load($user->uid)) { + if ($order = commerce_cart_order_load($user->uid, FALSE)) { // Count the number of product line items on the order. $wrapper = entity_metadata_wrapper('commerce_order', $order); $quantity = commerce_line_items_quantity($wrapper->commerce_line_items, commerce_product_line_item_types()); @@ -656,7 +656,7 @@ function commerce_cart_block_view($delta) { $content = theme('commerce_cart_empty_block'); // First check to ensure there are products in the shopping cart. - if ($order = commerce_cart_order_load($user->uid)) { + if ($order = commerce_cart_order_load($user->uid, FALSE)) { $wrapper = entity_metadata_wrapper('commerce_order', $order); // If there are one or more products in the cart... @@ -1432,7 +1432,7 @@ function commerce_cart_product_add_by_id($product_id, $quantity = 1, $combine = global $user; // If the specified product exists... - if ($product = commerce_product_load($product_id)) { + if ($product = commerce_product_load($product_id, FALSE)) { // Create a new product line item for it. $line_item = commerce_product_line_item_new($product, $quantity); @@ -2289,7 +2289,7 @@ function commerce_cart_add_to_cart_form_attributes_refresh($form, $form_state) { // Then render and return the various product fields that might need to be // updated on the page. if (!empty($form_state['context'])) { - $product = commerce_product_load($form_state['default_product_id']); + $product = commerce_product_load($form_state['default_product_id'], FALSE); $form_state['default_product'] = $product; $product->display_context = $form_state['context']; @@ -2396,7 +2396,7 @@ function commerce_cart_add_to_cart_views_form_refresh($form, $form_state) { */ function commerce_cart_add_to_cart_form_submit($form, &$form_state) { $product_id = $form_state['values']['product_id']; - $product = commerce_product_load($product_id); + $product = commerce_product_load($product_id, FALSE); // If the line item passed to the function is new... if (empty($form_state['line_item']->line_item_id)) { diff --git a/modules/cart/includes/commerce_cart.pages.inc b/modules/cart/includes/commerce_cart.pages.inc index 207f6bd..562d1c3 100644 --- a/modules/cart/includes/commerce_cart.pages.inc +++ b/modules/cart/includes/commerce_cart.pages.inc @@ -13,7 +13,7 @@ function commerce_cart_checkout_router() { global $user; // Load the shopping cart order. - if ($order = commerce_cart_order_load($user->uid)) { + if ($order = commerce_cart_order_load($user->uid, FALSE)) { $wrapper = entity_metadata_wrapper('commerce_order', $order); } @@ -38,7 +38,7 @@ function commerce_cart_view() { $content = theme('commerce_cart_empty_page'); // First check to make sure we have a valid order. - if ($order = commerce_cart_order_load($user->uid)) { + if ($order = commerce_cart_order_load($user->uid, FALSE)) { $wrapper = entity_metadata_wrapper('commerce_order', $order); // Only show the cart form if we found product line items. diff --git a/modules/payment/commerce_payment.module b/modules/payment/commerce_payment.module index f916e26..3d79fa0 100644 --- a/modules/payment/commerce_payment.module +++ b/modules/payment/commerce_payment.module @@ -923,7 +923,7 @@ function commerce_payment_transaction_delete_multiple($transaction_ids) { */ function commerce_payment_transaction_access($op, $transaction, $account = NULL) { if (isset($transaction->order_id)) { - $order = commerce_order_load($transaction->order_id); + $order = commerce_order_load($transaction->order_id, FALSE); if (!$order) { return FALSE; } diff --git a/modules/payment/commerce_payment.tokens.inc b/modules/payment/commerce_payment.tokens.inc index 8513019..da3ec12 100644 --- a/modules/payment/commerce_payment.tokens.inc +++ b/modules/payment/commerce_payment.tokens.inc @@ -212,7 +212,7 @@ function commerce_payment_tokens($type, $tokens, array $data = array(), array $o // Default values for the chained tokens handled below. case 'order': if ($transaction->order_id) { - $order = commerce_order_load($transaction->order_id); + $order = commerce_order_load($transaction->order_id, FALSE); $replacements[$original] = $sanitize ? check_plain($order->order_number) : $order->order_number; } break; @@ -239,7 +239,7 @@ function commerce_payment_tokens($type, $tokens, array $data = array(), array $o } if ($order_tokens = token_find_with_prefix($tokens, 'order')) { - $order = commerce_order_load($transaction->order_id); + $order = commerce_order_load($transaction->order_id, FALSE); $replacements += token_generate('commerce-order', $order_tokens, array('commerce-order' => $order), $options); } diff --git a/modules/payment/commerce_payment_ui.module b/modules/payment/commerce_payment_ui.module index bd728ae..f562686 100644 --- a/modules/payment/commerce_payment_ui.module +++ b/modules/payment/commerce_payment_ui.module @@ -144,7 +144,7 @@ function commerce_payment_ui_payment_transaction_uri($transaction) { // Only return a value if the transaction references an order and the user has // permission to view the payment transaction. - if ($order = commerce_order_load($transaction->order_id)) { + if ($order = commerce_order_load($transaction->order_id, FALSE)) { if (commerce_payment_transaction_access('view', $transaction)) { return array( 'path' => 'admin/commerce/orders/' . $order->order_id . '/payment/' . $transaction->transaction_id . '/view', diff --git a/modules/payment/includes/commerce_payment_transaction.controller.inc b/modules/payment/includes/commerce_payment_transaction.controller.inc index a646770..b3774e5 100644 --- a/modules/payment/includes/commerce_payment_transaction.controller.inc +++ b/modules/payment/includes/commerce_payment_transaction.controller.inc @@ -160,7 +160,7 @@ class CommercePaymentTransactionEntityController extends DrupalCommerceEntityCon */ public function buildContent($transaction, $view_mode = 'administrator', $langcode = NULL, $content = array()) { // Load the order this transaction is attached to. - $order = commerce_order_load($transaction->order_id); + $order = commerce_order_load($transaction->order_id, FALSE); // Add the default fields inherent to the transaction entity. if (!empty($transaction->instance_id) && $payment_method = commerce_payment_method_instance_load($transaction->instance_id)) { diff --git a/modules/payment/includes/views/handlers/commerce_payment_handler_field_balance.inc b/modules/payment/includes/views/handlers/commerce_payment_handler_field_balance.inc index 890867e..ca4a20a 100644 --- a/modules/payment/includes/views/handlers/commerce_payment_handler_field_balance.inc +++ b/modules/payment/includes/views/handlers/commerce_payment_handler_field_balance.inc @@ -44,7 +44,7 @@ class commerce_payment_handler_field_balance extends views_handler_field { $order_id = $this->get_value($values, 'order_id'); // Only render this field if we find a valid order. - if (!empty($order_id) && $order = commerce_order_load($order_id)) { + if (!empty($order_id) && $order = commerce_order_load($order_id, FALSE)) { $balance = commerce_payment_order_balance($order); // Output according to the format selected as with price fields. diff --git a/modules/payment/includes/views/handlers/commerce_payment_handler_field_payment_transaction_link_delete.inc b/modules/payment/includes/views/handlers/commerce_payment_handler_field_payment_transaction_link_delete.inc index 368127d..4ef31b8 100644 --- a/modules/payment/includes/views/handlers/commerce_payment_handler_field_payment_transaction_link_delete.inc +++ b/modules/payment/includes/views/handlers/commerce_payment_handler_field_payment_transaction_link_delete.inc @@ -9,7 +9,6 @@ class commerce_payment_handler_field_payment_transaction_link_delete extends com // Ensure the user has access to delete this payment transaction. $transaction_id = $this->get_value($values, 'transaction_id'); $order_id = $this->get_value($values, 'order_id'); - $order = commerce_order_load($order_id); $transaction = commerce_payment_transaction_load($transaction_id); if (commerce_payment_transaction_access('delete', $transaction)) { diff --git a/modules/product/commerce_product_ui.module b/modules/product/commerce_product_ui.module index 036bae2..251946e 100644 --- a/modules/product/commerce_product_ui.module +++ b/modules/product/commerce_product_ui.module @@ -231,7 +231,7 @@ function commerce_product_ui_help($path, $arg) { return (!empty($product_type['help']) ? '
' . filter_xss_admin($product_type['help']) . '
' : ''); } elseif ($arg[1] == 'commerce' && $arg[2] == 'products' && is_numeric($arg[3])) { - $product = commerce_product_load($arg[3]); + $product = commerce_product_load($arg[3], FALSE); $product_type = commerce_product_type_load($product->type); return (!empty($product_type['help']) ? '' . filter_xss_admin($product_type['help']) . '
' : ''); } diff --git a/modules/product_pricing/commerce_product_pricing.module b/modules/product_pricing/commerce_product_pricing.module index 19a6f46..4ea5021 100644 --- a/modules/product_pricing/commerce_product_pricing.module +++ b/modules/product_pricing/commerce_product_pricing.module @@ -280,7 +280,8 @@ function commerce_product_pre_calculate_sell_prices($from = NULL, $count = 1) { } while ($product_id = $query->fetchField()) { - $product = commerce_product_load($product_id); + // Load the product, no locking is required since we do not have to save it. + $product = commerce_product_load($product_id, FALSE); // If the product is valid for pre-calculation... if (commerce_product_valid_pre_calculation_product($product)) { diff --git a/modules/product_reference/commerce_product_reference.module b/modules/product_reference/commerce_product_reference.module index 59f4d0d..b7119b7 100644 --- a/modules/product_reference/commerce_product_reference.module +++ b/modules/product_reference/commerce_product_reference.module @@ -760,7 +760,7 @@ function commerce_product_reference_field_formatter_prepare_view($entity_type, $ } if ($product_ids) { - $products = entity_load('commerce_product', $product_ids); + $products = commerce_product_load_multiple($product_ids, array('_lock' => FALSE)); } else { $products = array();