Post by mohaelattar » Wed May 22, 2019 8:08 pm

when add or edit product appear this error : Notice: Undefined index: stock_status_id in /home/linkysoft/public_html/demo.linkysoft.com/m3rad/admin/model/catalog/product.php on line 138Warning: Cannot modify header information - headers already sent by (output started at /home/linkysoft/public_html/demo.linkysoft.com/m3rad/admin/controller/startup/error.php:34) in /home/linkysoft/public_html/demo.linkysoft.com/storage/modification/system/library/response.php on line 36

but it add or edit suceessfully when return to product ??

Newbie

Posts

Joined
Mon Apr 22, 2019 2:57 am

Post by letxobnav » Thu May 23, 2019 11:24 pm

you do actually have an issue here as admin/model/catalog/product.php on line 138 is the product update query and in that query

Code: Select all

stock_status_id = '" . (int)$data['stock_status_id'] 
index stock_status_id should not be undefined.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by developer123123 » Tue Dec 07, 2021 1:00 am

I also have the same problem, OC 3.0.2.0,

Notice: Undefined index: stock_status_id in /home/smarteye/public_html/galaxysecurity.com/storage/modification/admin/model/catalog/product.php on line 164Notice: Undefined index: stock_statuses in /home/smarteye/public_html/galaxysecurity.com/storage/modification/admin/controller/localisation/stock_status.php on line 213Warning: Invalid argument supplied for foreach() in /home/smarteye/public_html/galaxysecurity.com/storage/modification/admin/controller/localisation/stock_status.php on line 213Warning: Cannot modify header information - headers already sent by (output started at /home/smarteye/public_html/galaxysecurity.com/admin/controller/startup/error.php:34) in /home/smarteye/public_html/galaxysecurity.com/storage/modification/system/library/response.php on line 42


code line 164 :

public function editProduct($product_id, $data) {
$this->db->query("UPDATE " . DB_PREFIX . "product SET model = '" . $this->db->escape($data['model']) . "', sku = '" . $this->db->escape($data['sku']) . "', upc = '" . $this->db->escape($data['upc']) . "', ean = '" . $this->db->escape($data['ean']) . "', jan = '" . $this->db->escape($data['jan']) . "', isbn = '" . $this->db->escape($data['isbn']) . "', mpn = '" . $this->db->escape($data['mpn']) . "', location = '" . $this->db->escape($data['location']) . "', quantity = '" . (int)$data['quantity'] . "', minimum = '" . (int)$data['minimum'] . "', subtract = '" . (int)$data['subtract'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', date_available = '" . $this->db->escape($data['date_available']) . "', manufacturer_id = '" . (int)$data['manufacturer_id'] . "', shipping = '" . (int)$data['shipping'] . "', price = '" . (float)$data['price'] . "', points = '" . (int)$data['points'] . "', weight = '" . (float)$data['weight'] . "', weight_class_id = '" . (int)$data['weight_class_id'] . "', length = '" . (float)$data['length'] . "', width = '" . (float)$data['width'] . "', height = '" . (float)$data['height'] . "', length_class_id = '" . (int)$data['length_class_id'] . "', status = '" . (int)$data['status'] . "', tax_class_id = '" . (int)$data['tax_class_id'] . "', sort_order = '" . (int)$data['sort_order'] . "', date_modified = NOW() WHERE product_id = '" . (int)$product_id . "'");

New member

Posts

Joined
Tue Oct 26, 2021 3:36 am

Post by ADD Creative » Tue Dec 07, 2021 6:08 am

It will be caused by an extension that is modifying the product editor.

Also you need make sure display errors in set to off in all 3 places. Your PHP settings, in system/config/default.php and in the settings. Not only can this cause minor notices and warnings to cause bigger errors, it can also be a security risk.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by developer123123 » Wed Dec 08, 2021 5:35 am

Could you specify where exactly in the code I need to change to make the error notify shut off??

New member

Posts

Joined
Tue Oct 26, 2021 3:36 am

Post by ADD Creative » Wed Dec 08, 2021 9:33 am

developer123123 wrote:
Wed Dec 08, 2021 5:35 am
Could you specify where exactly in the code I need to change to make the error notify shut off??
1. In your PHP settings make sure display_errors is set to Off. Use phpinfo() to check. It should be off by default, but there are lots of rubbish hosts out there.

2. In system/config/default.php set error_display to false.

3. In your OpenCart Setting on the server tab set Display Errors to No.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by developer123123 » Thu Dec 09, 2021 12:05 am

thanks, it solved.
after turn of all display error to false

New member

Posts

Joined
Tue Oct 26, 2021 3:36 am

Post by OSWorX » Thu Dec 09, 2021 12:39 am

developer123123 wrote:
Thu Dec 09, 2021 12:05 am
thanks, it solved.
after turn of all display error to false
Well, just disabling the error output is not "solved" (in my opinion).
Just hiding the errors.
It would be much better if you really solve them by eleminating what it's causing.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: DesignCart and 101 guests