dvir Posted September 1, 2015 Share Posted September 1, 2015 hi, i'm getting an error in my website : Notice: Array to string conversion in /home/dviry/public_html/classes/Dispatcher.php on line 676 what is this error ? how can i fix it ? Link to comment Share on other sites More sharing options...
NemoPS Posted September 2, 2015 Share Posted September 2, 2015 Prestashop version? Link to comment Share on other sites More sharing options...
dvir Posted September 2, 2015 Author Share Posted September 2, 2015 Prestashop version? 1.6.0.14 Link to comment Share on other sites More sharing options...
vekia Posted September 3, 2015 Share Posted September 3, 2015 you've got this error all the time or only on some pages? Link to comment Share on other sites More sharing options...
NemoPS Posted September 4, 2015 Share Posted September 4, 2015 THere is nothing as strings on that line. DId you modify your dispatcher?Also, check if you have any module hooked to moduleRoutes Link to comment Share on other sites More sharing options...
dvir Posted September 4, 2015 Author Share Posted September 4, 2015 you've got this error all the time or only on some pages? On all pages. Link to comment Share on other sites More sharing options...
dvir Posted September 4, 2015 Author Share Posted September 4, 2015 THere is nothing as strings on that line. DId you modify your dispatcher? Also, check if you have any module hooked to moduleRoutes i dont have any moduleRoutes ...i'm searching in position , but i cant see module in that name Link to comment Share on other sites More sharing options...
dvir Posted September 4, 2015 Author Share Posted September 4, 2015 hi , i've looked in the error_log , and here is all the error : [04-Sep-2015 13:07:44 Israel] PHP Notice: Array to string conversion in /home/dviry/public_html/classes/Dispatcher.php on line 676[04-Sep-2015 13:07:44 Israel] PHP Notice: Array to string conversion in /home/dviry/public_html/classes/Dispatcher.php on line 676[04-Sep-2015 13:07:45 Israel] PHP Notice: Undefined index: newProducts in /home/dviry/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 46[04-Sep-2015 13:07:45 Israel] PHP Notice: Trying to get property of non-object in /home/dviry/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 46 Link to comment Share on other sites More sharing options...
dvir Posted September 4, 2015 Author Share Posted September 4, 2015 i dont have any moduleRoutes ...i'm searching in position , but i cant see module in that name i found IT ! but it raise a lot of questions : when i turned off the option "Friendly URL" - the error disappear ! but why ? is it good for an e-commerce website , that all the time change product - to work with Friendly URL? or i better find what is the problem , and i should work with Friendly URL? hope to get from you the answer what do to ... thanks Link to comment Share on other sites More sharing options...
NemoPS Posted September 5, 2015 Share Posted September 5, 2015 Because it's not using the dispatcher in that case. Can you check what you have at line 676 of the file and post t here? Link to comment Share on other sites More sharing options...
dvir Posted September 5, 2015 Author Share Posted September 5, 2015 (edited) Because it's not using the dispatcher in that case. Can you check what you have at line 676 of the file and post t here? // Build an url which match a route if ($this->use_routes || $force_routes) { $url = $route['rule']; $add_param = array(); foreach ($params as $key => $value) { if (!isset($route['keywords'][$key])) { if (!isset($this->default_routes[$route_id]['keywords'][$key])) $add_param[$key] = $value; } else { if ($params[$key]) $replace = $route['keywords'][$key]['prepend'].$params[$key].$route['keywords'][$key]['append']; ----- THIS IS LINE 676 else $replace = ''; $url = preg_replace('#\{([^{}]*?'.$key.'(:[^{}]*)?\}#', $replace, $url); } } $url = preg_replace('#\{([^{}]*?[a-z0-9_]+?(:[^{}]*)?\}#', '', $url); if (count($add_param)) $url .= '?'.http_build_query($add_param, '', '&'); } Edited September 5, 2015 by dvir (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted September 5, 2015 Share Posted September 5, 2015 RIght inside the else {Write thisvar_dump($route['keywords'][$key]['prepend']);die();See what the dump isYou can try this as wellvar_dump($params[$key]); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now