On the stock edit form (node/%/edit/stock), the following message appears when there are no sku's defined for the node:

Notice: Undefined variable: rows in theme_uc_stock_edit_form() (line 323 of ...\sites\all\modules\contrib\ubercart\uc_stock\uc_stock.admin.inc).

CommentFileSizeAuthor
#1 ubercart-undefined_variable-1505276-1.patch426 bytesglekli

Comments

glekli’s picture

Status: Active » Needs review
StatusFileSize
new426 bytes

Submitting a patch to fix it.

tr’s picture

Status: Needs review » Postponed (maintainer needs more info)

How did you create a node without a SKU? That's a required form element, and you should *never* have a product node without a SKU. So no, I don't think hiding the error is the correct thing to do here - you need to identify how the node can get created without a SKU then prevent that from happening.

glekli’s picture

On this particular site, a content type that is set up as a product has some nodes that are not intended for sale, and those nodes do not have the sku field filled in.
I don't think defining a variable before using it could be considered 'hiding an error' in any scenario. Nevertheless, I understand that UC is set up so that it requires a sku to behave normally.

longwave’s picture

Status: Postponed (maintainer needs more info) » Fixed

Committed to both branches as it's a trivial fix.

Status: Fixed » Closed (fixed)

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