Post by distinct » Thu Feb 22, 2018 3:19 am

I am getting 2 errors from the same page PHP Notice: Undefined index: route in .../vqmod/vqcache/vq2-catalog_controller_common_header.php on line 19
and
PHP Notice: Undefined index: route in .../vqmod/vqcache/vq2-catalog_controller_common_header.php on line 23
These are referencing this code:
// start body_class code
$current_path = $this->request->get;
19> if (empty($current_path) || $current_path['route'] == 'common/home') {
$body_class = 'home';
}
else {
23> $body_class = explode('/', str_replace('product/', '', $current_path['route']));
unset($current_path['route']);
if (isset($current_path['_route_'])) {
$body_class = array_merge($body_class, explode('/', str_replace('-', '_', $current_path['_route_'])));
unset($current_path['_route_']);
}
foreach ($current_path as $key => $value) {
$body_class[] = $key . "_" . $value;
}
$body_class = 'page_' . implode(" page_", array_unique($body_class));
}
$body_class .= ' lang_' . $this->language->get('code');
$this->data['body_class'] = $body_class;

// end body_class code

to be sure it wasn't what I seen on another post I have checked my /template/common/header.tpl for this code:
<body class="<?php echo $body_class; ?>">

can someone please help. I just want to clear my error log
TIA

Newbie

Posts

Joined
Wed Aug 31, 2011 11:12 am

Post by IP_CAM » Thu Feb 22, 2018 4:07 am

Well, then just remove the VqMod, containing this line, since it is not part of the
default catalog/controller/common/header.php file in OC v.1.5.6.4:

Code: Select all

if (empty($current_path) || $current_path['route'] == 'common/home') {
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by straightlight » Thu Feb 22, 2018 6:35 am

Replace:

Code: Select all

if (empty($current_path) || $current_path['route'] == 'common/home') {
with:

Code: Select all

if ((empty($current_path)) || (!empty($current_path['route']) && $current_path['route'] == 'common/home')) {
Then, replace:

Code: Select all

$body_class = explode('/', str_replace('product/', '', $current_path['route']));
unset($current_path['route']);
with:

Code: Select all

if (!empty($current_path['route'])) {
$body_class = explode('/', str_replace('product/', '', $current_path['route']));
unset($current_path['route']);
}

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by distinct » Mon Feb 26, 2018 3:46 am

Awesome that looks like it fixed it

Newbie

Posts

Joined
Wed Aug 31, 2011 11:12 am
Who is online

Users browsing this forum: No registered users and 28 guests