When no shipping services are defined (that could happen if I'm only interested in capture shipping address) a warning arise:

Notice: Undefined index: shipping_rates in commerce_shipping_pane_checkout_form_validate() (line 257 of /Users/pablocc/Sites/bluesparklabs/PDGA/www/sites/all/modules/contrib/commerce_shipping/includes/commerce_shipping.checkout_pane.inc).

This is resolved simply adding isset call in the line.

Comments

citlacom’s picture

Status: Active » Needs review
StatusFileSize
new1.37 KB

Here the patch.

citlacom’s picture

Previous patch miss a parenthesis, use this instead.

jwilson3’s picture

I can confirm this patch does what it says, but since I'm working on the same project as citlacom, will leave it to someone else to also verify.

rszrama’s picture

Status: Needs review » Fixed

I actually don't have this problem. We do define this variable whether there are services or not in the form builder:

  $pane_form['shipping_rates'] = array(
    '#type' => 'value',
    '#value' => FALSE,
  );

My hunch is you have an alteration or something that's interfering with the code from working; or it's just something that's beyond me. That said, I prefer empty() checks to using a mixed type variable as a boolean. I'll update the validate handler to use that. : )

Status: Fixed » Closed (fixed)

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