Closed (fixed)
Project:
Commerce Shipping
Version:
7.x-1.0-rc3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Sep 2011 at 14:14 UTC
Updated:
14 Jan 2012 at 16:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
Jason Dean commentedI'm running a fresh installation of Kickstart with two rules disabled to prevent Commerce creating user profiles: 'Assign an anonymous order to a pre-existing user' and 'Create a new account for an anonymous order'.
I get the same errors as above when anonymous user places an order.
Thanks :)
Comment #2
Tom P commentedI get this same error when an anonymous user checks out and enters an invalid email address.
Comment #3
kim.pepperWe get this error when logged in as a user as well.
Comment #4
murrayw commentedConfirming that this bug happens to me as well. The Notices are displayed when there is an error in the form somewhere. For us this happens when the payment gateway knocks back the transaction.
I've done a bit of poking around but am not knowledagble enough to provide a patch. However, hopefully the following findings will help someone who does.
The problem is arising in:
commerce_shipping_pane_checkout_form_validate($form, &$form_state, $checkout_pane, $order)The
$checkout_pane['pane_id']equals 'commerce_shipping', as you would expect. However, this key doesn't exist in$formor$form_state['values']. There is however a key for 'customer_profile_shipping' in both form arrays.Switching to use 'customer_profile_shipping' key won't help much as the code then goes on to look for other keys which don't exist. Instead of 'shipping_details' there is 'commerce_customer_address', etc. So, there is too much wrong here for me to make an easy fix.
Interestingly, making the function return
TRUEno matter what still leads to validation being done on the shipping pane.Hope this helps someone.
Comment #5
essbee commentedI get this same group of errors. Appears in both RC1 and latest dev
Comment #6
googletorp commentedI have not been able to trigger this error with 1.x dev
Comment #7
quartertonecreative commentedConfirming that this is also happening for me, both on RC2 and the latest Dev. It's definitely a messy string of errors if somebody makes an error with the email field, or messes up a coupon code, or something. Any attention to this would be much appreciated, I'm just not up to the task ability-wise to even know where to look!
Comment #8
m_wiking commentedI get this error too. I use 7.x-1.0-rc2. (Tried the dev version but it breaks the code when I add items to the cart.)
I'm logged in as admin and I just make a normal checkout.
Please look in the image for the errors I get using rc2. Below I list them one by one in the order they come.
Notice: Undefined index: commerce_shipping in commerce_shipping_pane_checkout_form_submit() (line 144 of /Users/mattias/NetBeansProjects/th_milk2/profiles/commerce_kickstart/modules/contrib/commerce_shipping/includes/commerce_shipping.checkout_pane.inc).
Notice: Undefined index: shipping_methods in commerce_shipping_pane_checkout_form_validate() (line 120 of /Users/mattias/NetBeansProjects/th_milk2/profiles/commerce_kickstart/modules/contrib/commerce_shipping/includes/commerce_shipping.checkout_pane.inc).
Notice: Undefined index: commerce_shipping in commerce_shipping_pane_checkout_form_validate() (line 113 of /Users/mattias/NetBeansProjects/th_milk2/profiles/commerce_kickstart/modules/contrib/commerce_shipping/includes/commerce_shipping.checkout_pane.inc).
Notice: Undefined index: commerce_shipping in commerce_shipping_pane_checkout_form_validate() (line 112 of /Users/mattias/NetBeansProjects/th_milk2/profiles/commerce_kickstart/modules/contrib/commerce_shipping/includes/commerce_shipping.checkout_pane.inc).
Comment #9
googletorp commentedI'm not seeing this error - when updating to dev remember to run update.php
Comment #10
mixedfeelings commentedI am experiencing the same set of errors - could it be a conflict with another module? I was getting it with every version of the module, currently I have RC2 activated.
Comment #11
netsensei commentedSame thing: I'm seeing this error after installing shipping rc3 + commerce 1.1. The setup is pretty much vanilla. Doesn't matter if I'm logged in or not.
Interesting enough, when I reload the review page, i.e. checkout/26/review, then the errors dissappear. As if the form is rebuild and the missing keys are added on reload. So, rather then fixing the keys as #4 suggests, I would approach this by looking when, how the pane gets AWOL during the initial load of the review page.
Comment #12
googletorp commented#11 What you are seeing is a bug in commerce, as the shipping form is missing from the form array, yet the validation is called.
Comment #13
netsensei commentedYes. Somehow, the shipping pane isn't called on the review page. Or it's called at the wrong time. I've been looking in the issue queue of Commerce based for references mentioning the commerce_checkout_panes() function, but couldn't find anything related to this problem. Any ideas?
Comment #14
netsensei commentedI just bluntly ripped out commerce_shipping_pane_checkout_form_validate() and commerce_shipping_pane_checkout_form_submit() functions alltogether and the shipping information saves nicely. Which suits me and my project just fine. Of course, I lose the extra logic that other projects might need. :s
Comment #15
googletorp commentedWithout the submit handler, Commer Shipping won't create or delete shipping line items, which makes it rather useless.
Comment #16
dpolant commentedIf at all possible, anyone having this problem should switch to 2.x, although there wasn't an upgrade path last time I checked you'll have to write some manual sql updates to get it working.
As a quick fix on this branch, make sure you are using the checkout pane called "shipping information" not "shipping." This fixed it for me.
The underlying issue here is that shipping 1.x provides an extra shipping pane. It uses both hook_commerce_checkout_pane_info and hook_commerce_customer_profile_type_info to provide data for checkout panes, when in fact only hook_commerce_customer_profile_type_info is necessary because the customer profile module creates the appropriate panes on its own.
Comment #17
dpolant commentedsorry, posted twice ..
Comment #18
googletorp commentedYou are confusing things dpolant, hook_commerce_customer_profile_type_info creates a customer profile, (shipping) which is what creates the shipping address. This is not actually a field, but a customer profile reference field on the order.
hook_commerce_customer_profile_type_info is where the shipping pane is defined, which creates the pane, where you can choose shipping method and which handles what's needed to create the shipping line item(s), add them to the order and save both.
I still haven't see any indication of this error, which is actually caused by commerce shipping since the proposed fix.
Comment #19
netsensei commentedShipping 2.x works for me without any problems.
Comment #20
googletorp commentedMarking this as fixed. If any new info comes up, I'll review this again.