Page 1 of 1

Undefined variable when adding new product/category...

Posted: Tue Mar 17, 2009 12:50 pm
by iloveopencart
Just downloaded the latest, greatest OpenCart v1.1.9 (9:45pm) and noticed the following bugs:

Got this error in the product form after clicking the Insert button in the product list:

Notice: Undefined variable: product_info in C:\wamp\www\opencart_v1.1.9\admin\controller\catalog\product.php on line 469

Got this one in the category form after clicking Insert in the category list:

Notice: Undefined variable: category_info in C:\wamp\www\opencart_v1.1.9\admin\controller\catalog\category.php on line 202

Got this one in the manufacturer form after clicking Insert in the manufacturer list:

Notice: Undefined variable: manufacturer_info in C:\wamp\www\opencart_v1.1.9\admin\controller\catalog\manufacturer.php on line 321

When these errors occur, the page doesn't seem to render properly either - the font changes, the menu shifts to the right. These errors ONLY occur when trying to create something new. There are no errors when clicking on edit.

Re: Undefined variable when adding new product/category...

Posted: Tue Mar 17, 2009 1:03 pm
by iloveopencart
Looks like a simple fix: just put a @ in front of the variable:

\admin\controller\catalog\product.php on line 469 should be:

$this->data['image'] = @$product_info['image'];

\admin\controller\catalog\category.php on line 202 should be:

$this->data['image'] = @$category_info['image'];

\admin\controller\catalog\manufacturer.php on line 321

$this->data['image'] = @$category_info['image'];

Re: Undefined variable when adding new product/category...

Posted: Tue Mar 17, 2009 7:30 pm
by Daniel
Fixed this in the laatest commit.