If a product is disabled, we'll get a warning on the product display node:
Undefined index: product_id in commerce_stock_form_alter() (line 59 of /var/www/training.drupalcommerce.org/sites/all/modules/commerce_stock/commerce_stock.module).

Comments

guy_schneerson’s picture

thanks @rfay for spotting this, easy to recreate and should be easy to fix

guy_schneerson’s picture

Assigned: Unassigned » guy_schneerson
Status: Active » Needs work

note to self

need to add to
commerce_stock_form_alter()

the following lines at the top of the function
// ccheck if product is disabled
if ( isset($form['submit']['#disabled']) && ($form['submit']['#disabled'] == 1) ) {
return;
}

will add as a patch later on this week (need to make sure it works with my previous patches not committed yet)

guy_schneerson’s picture

Assigned: guy_schneerson » Unassigned
Status: Needs work » Needs review
StatusFileSize
new990 bytes

Patch

guy_schneerson’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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