Every time I add or modify a product kit, I get:

Notice: Undefined index: shippable in uc_ups_product_alter_validate() (line 134 of ubercart/shipping/uc_ups/uc_ups.module)

Indeed, there is no field for shippable on the form.

Comments

bancarddata’s picture

Component: Shipping » Product kits
bancarddata’s picture

Actually I seem to get this error every time I save a product node as well.

bancarddata’s picture

Component: Product kits » Products

The line it complains about is:

if ($form_state['values']['shippable'] && ($form_state['values']['shipping_type'] == 'small_package' || (empty($form_state['values']['shipping_type']) && variable_get('uc_store_shipping_type', 'small_package') == 'small_package'))) {

Not sure what the problem would be with that. The field is definitely set in the database as a 1. for products that are producing this error upon save.

bancarddata’s picture

Status: Active » Needs review
StatusFileSize
new1.06 KB

Attached is a patch that gets rid of the notice, but I am not sure if it is the correct fix.

tr’s picture

What I wonder is why no one else sees this PHP notice. I suspect it's because a contributed module on your site is causing the 'shippable' key to be lost somewhere. I never see this. Nothing wrong with the patch, but it seems to just hide the notice without correcting the cause. The product form should *always* have a 'shippable' key; that key is defined in uc_product_form().

bancarddata’s picture

The main reason I did that in the patch was because I saw the same type of test done in ./payments/uc_paypal/uc_paypal.pages.inc at line 348 and 358 and thought maybe it needed to be in there.

You must be right that it is the fault of a contrib module. The modules that I use that relate to Ubercart are uc_attributes_in_cart, uc_fedex, uc_feeds, uc_tracking, and a small module I made myself that adds an empty cart button to the cart page. Disabling these one at a time along with a cache flush did not seem to affect the notice at all.

Any tips on how I might be able to track down how I am losing the shippable key? Would it have to be something else that is using hook_form_alter on the product_form?

bancarddata’s picture

Component: Products » Product kits
Category: bug » support
Status: Needs review » Postponed (maintainer needs more info)

I was mistaken. It definitely only happens on Product Kits. It showed up when I saved products only because those products were part of a kit which was also being updated at the same time. Updating the issue as I think this is something I did. Will report back later.

longwave’s picture

Category: support » bug
Priority: Normal » Minor
Status: Postponed (maintainer needs more info) » Fixed

This is only a form validation function, it looks like this was one of the many bits of code left over from 6.x-2.x that tests array entries without using isset(). Fix committed.

Status: Fixed » Closed (fixed)

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