Page 1 of 1

Undefined index: parent_id in /seo_url.php on line 53

Posted: Tue Feb 02, 2016 11:04 am
by allgoo
hello,

i have a problem in /system/storage/modification/catalog/controller/common/seo_url.php on line 53

Code: Select all

52:  $category_result = $this->db->query("SELECT * FROM " . DB_PREFIX . "category WHERE category_id = '" . $category_id . "'");
53:  $category_id = (int)$category_result->row['parent_id'];
54:  if ($category_id > 0 && !in_array($category_id, $found_path)) {

Re: Undefined index: parent_id in /seo_url.php on line 53

Posted: Tue Feb 02, 2016 3:16 pm
by Randem
Hi allgoo,

Either there is no data returned from the query or the field 'parent_id' does not exist in the category table.
There should be a check to see if anything is returned from the query before attempting to operate on the resultset.

Re: Undefined index: parent_id in /seo_url.php on line 53

Posted: Tue Feb 02, 2016 9:07 pm
by allgoo
Randem wrote:Hi allgoo,

Either there is no data returned from the query or the field 'parent_id' does not exist in the category table.
There should be a check to see if anything is returned from the query before attempting to operate on the resultset.
so basically you are saying that this error is caused because there is no parent category, wrong URL end ?

Re: Undefined index: parent_id in /seo_url.php on line 53

Posted: Wed Feb 03, 2016 3:39 am
by Randem
No, I stated EXACTLY what it meant. There is no URL in the code you posted. ???