Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
At the moment there is a silent dependency on commerce_cart if you want to display links:
function theme_commerce_checkout_progress_list($variables) {
...
// Option to display back pages as links.
if ($link) {
// Load the *shopping cart* order. It gets deleted on last page.
if ($order = commerce_cart_order_load($GLOBALS['user']->uid)) {
$order_id = $order->order_id;
}
}
...
}
Either the dependency should be declared in the .info or, better yet, we should wrap this in module_exists()
. Along with this, would it not be better to pull the order from the active menu item if we are on the checkout pages?
Comment | File | Size | Author |
---|---|---|---|
#5 | 1948096-5-correct_precendent_of_order_load.patch | 1.12 KB | andrewbelcher |
#1 | 1948096-1-fix_dependency_on_commerce_cart.patch | 1.41 KB | andrewbelcher |
Comments
Comment #1
andrewbelcher CreditAttribution: andrewbelcher commentedHere is a patch implementing the suggested fix.
Comment #2
jcisio CreditAttribution: jcisio commentedThanks. Committed with a modification to keep it backward compatible: b1493e0.
Comment #4
andrewbelcher CreditAttribution: andrewbelcher commentedThanks for committing this. However, I think the modification you made results in unexpected behavior. If you are in the checkout process for an order that isn't your 'cart' order, this will continue using the cart order.
Comment #5
andrewbelcher CreditAttribution: andrewbelcher commentedHere's a patch that swaps them round to what I believe to be the correct precedent.
Comment #7
jcisio CreditAttribution: jcisio commentedI don't understand what could be "an order that isn't your 'cart' order". However I've committed a fix which logically fallback to commerce_cart if it can't detect $order from the URL.