Invalid product vars
at line 173 in file classes/Link.php
168. if (is_array($product) && isset($product['id_product'])) {
169. $params['id'] = $product['id_product'];
170. } elseif ((int) $product) {
171. $params['id'] = $product;
172. } else {
173. throw new PrestaShopException('Invalid product vars');
174. }
175. } else {
176. $params['id'] = $product->id;
177. }
178.
205. }
206.
207. switch ($redirect_type) {
208. case RedirectType::TYPE_PRODUCT_PERMANENT:
209. header('HTTP/1.1 301 Moved Permanently');
210. header('Location: ' . $this->context->link->getProductLink($this->product->id_type_redirected));
211. exit;
212. case RedirectType::TYPE_PRODUCT_TEMPORARY:
213. header('HTTP/1.1 302 Moved Temporarily');
214. header('Cache-Control: no-cache');
215. header('Location: ' . $this->context->link->getProductLink($this->product->id_type_redirected));
162. 'entity' => 'product',
163. 'id' => $this->id_product,
164. ]);
165.
166. // Performs multiple checks and redirects user to error page if needed
167. $this->checkPermissionsToViewProduct();
168.
169. // Load product category
170. $this->initializeCategory();
171. }
172.
295. /**
296. * Starts the controller process (this method should not be overridden!).
297. */
298. public function run()
299. {
300. $this->init();
301. if ($this->checkAccess()) {
302. // setMedia MUST be called before postProcess
303. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
304. $this->setMedia();
305. }
505.
506. // Execute hook dispatcher
507. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
508.
509. // Running controller
510. $controller->run();
511.
512. // Execute hook dispatcher after
513. Hook::exec('actionDispatcherAfter', $params_hook_action_dispatcher);
514. } catch (PrestaShopException $e) {
515. $e->displayMessage();
23. * @copyright Since 2007 PrestaShop SA and Contributors
24. * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
25. */
26.
27. require dirname(__FILE__).'/config/config.inc.php';
28. Dispatcher::getInstance()->dispatch();