Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyg5000/a781d2eba3d0fdb5c8ca to your computer and use it in GitHub Desktop.
Save andyg5000/a781d2eba3d0fdb5c8ca to your computer and use it in GitHub Desktop.
commerce_shipping-revert_76e2a50ceb5a9cb2f345fc165ea9193a18c39a84.patch
From 1c9ba0d087af70e9c9a4c6c17a1dd5b279ad7901 Mon Sep 17 00:00:00 2001
From: Andy Giles <andyg5000@gmail.com>
Date: Tue, 11 Nov 2014 20:31:59 -0500
Subject: [PATCH] Revert "Issue #2026321 by tatyana, andyg5000, plach: Fixed
Avoid overwriting an already updated order."
This reverts commit 76e2a50ceb5a9cb2f345fc165ea9193a18c39a84.
---
includes/commerce_shipping.checkout_pane.inc | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/includes/commerce_shipping.checkout_pane.inc b/includes/commerce_shipping.checkout_pane.inc
index de7047b..e463ee0 100644
--- a/includes/commerce_shipping.checkout_pane.inc
+++ b/includes/commerce_shipping.checkout_pane.inc
@@ -178,20 +178,6 @@ function commerce_shipping_recalculate_services_refresh($form, $form_state) {
* Validate callback for recalculating shipping services.
*/
function commerce_shipping_recalculate_services_validate($form, &$form_state) {
-
- // Load latest version of the order.
- $order = commerce_order_load($form_state['order']->order_id);
- // Check if the order is still on the same checkout step.
- $checkout_page = $form_state['checkout_page'];
- if ($form_state['order']->changed < $order->changed || !commerce_checkout_page_access($checkout_page, $order)) {
- // Clear all errors.
- form_clear_error();
- watchdog('access denied', check_plain($_GET['q']), NULL, WATCHDOG_WARNING);
- drupal_set_message(t('You are not authorized to access this command.'), 'error');
- $form_state['rebuild'] = TRUE;
- return FALSE;
- }
-
// Call all validation callbacks.
$recalculate = commerce_shipping_recalculate_services($form, $form_state);
@@ -299,7 +285,7 @@ function commerce_shipping_recalculate_services_submit($form, &$form_state) {
if ($rebuild) {
// Avoid overwriting an already updated order.
$stored_order = commerce_order_load($order->order_id);
- if ($stored_order->changed <= $order->changed) {
+ if ($stored_order->changed < $order->changed) {
commerce_order_save($order);
}
$form_state['rebuild'] = TRUE;
--
1.8.5.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment