As an anonymous user, if I enter an invalid email address at the checkout under Account Information I guess the following:

    Notice: Undefined index: commerce_shipping in commerce_shipping_pane_checkout_form_validate() (line 112 of commerce_shipping/includes/commerce_shipping.checkout_pane.inc).
    Notice: Undefined index: commerce_shipping in commerce_shipping_pane_checkout_form_validate() (line 113 of commerce_shipping/includes/commerce_shipping.checkout_pane.inc).
    Notice: Undefined index: shipping_methods in commerce_shipping_pane_checkout_form_validate() (line 120 of commerce_shipping/includes/commerce_shipping.checkout_pane.inc).
    Notice: Undefined index: commerce_shipping in commerce_shipping_pane_checkout_form_submit() (line 144 of commerce_shipping/includes/commerce_shipping.checkout_pane.inc).
    Notice: Undefined index: commerce_shipping in commerce_shipping_pane_checkout_form_submit() (line 145 of commerce_shipping/includes/commerce_shipping.checkout_pane.inc).

Comments

Jason Dean’s picture

I'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 :)

Tom P’s picture

I get this same error when an anonymous user checks out and enters an invalid email address.

kim.pepper’s picture

We get this error when logged in as a user as well.

murrayw’s picture

Confirming 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 $form or $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 TRUE no matter what still leads to validation being done on the shipping pane.

Hope this helps someone.

essbee’s picture

I get this same group of errors. Appears in both RC1 and latest dev

googletorp’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new55.82 KB

I have not been able to trigger this error with 1.x dev

quartertonecreative’s picture

Confirming 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!

m_wiking’s picture

StatusFileSize
new60.32 KB

I 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).

googletorp’s picture

I'm not seeing this error - when updating to dev remember to run update.php

mixedfeelings’s picture

I 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.

netsensei’s picture

Version: 7.x-1.0-rc1 » 7.x-1.0-rc3
StatusFileSize
new57.28 KB

Same 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.

googletorp’s picture

#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.

netsensei’s picture

Yes. 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?

netsensei’s picture

I 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

googletorp’s picture

Without the submit handler, Commer Shipping won't create or delete shipping line items, which makes it rather useless.

dpolant’s picture

Status: Postponed (maintainer needs more info) » Active

If 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.

dpolant’s picture

sorry, posted twice ..

googletorp’s picture

Status: Active » Postponed (maintainer needs more info)

You 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.

netsensei’s picture

Shipping 2.x works for me without any problems.

googletorp’s picture

Status: Postponed (maintainer needs more info) » Fixed

Marking this as fixed. If any new info comes up, I'll review this again.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.