Jump to content

Invalid product vars at line 106 in file classes/Link.php


Franz_xAlp

Recommended Posts

Hi all,

I have a problem that report error 500 when I try to a wrong name page, or a product not more active.

This is the report of exception.

Thx,

 

[PrestaShopException]

Invalid product vars

at line 106 in file classes/Link.php

101.             if (is_array($product) && isset($product['id_product'])) {

102.                 $product = new Product($product['id_product'], false, $id_lang, $id_shop);

103.             } elseif ((int)$product) {

104.                 $product = new Product((int)$product, false, $id_lang, $id_shop);

105.             } else {

106.                 throw new PrestaShopException('Invalid product vars');

107.             }

108.         }

109.

110.         // Set available keywords

111.         $params = array();

 

    LinkCore->getProductLink - [line 3940 - modules/lgcomments/lgcomments.php] - [2 Arguments]

 

    3935.             $sumcomments = $this->getSumProdComments(Tools::getValue('id_product', 0));

    3936.             $averagecomments = @round($sumcomments / $countcomments);

    3937.         }

    3938.         $zerostar = Configuration::get('PS_LGCOMMENTS_DISPLAY_ZEROSTAR');

    3939.         $productrewrite = $this->getProductRewrite(Tools::getValue('id_product', 0));

    3940.         $productlink = $this->context->link->getProductLink(Tools::getValue('id_product', 0), $productrewrite);

    3941.         $prodtopmargin = Configuration::get('PS_LGCOMMENTS_PRODTOPMARGIN');

    3942.         $prodbotmargin = Configuration::get('PS_LGCOMMENTS_PRODBOTMARGIN');

    3943.         if ($countcomments) {

    3944.             $this->context->smarty->assign(array(

    3945.                 'comments' => $countcomments,

 

    LGComments->hookExtraRight - [line 587 - classes/Hook.php] - [1 Arguments]

 

    582.             }

    583.         }

    584.

    585.         // Immediately return the result if we do not log performances

    586.         if (!Module::$_log_modules_perfs) {

    587.             return $module->{$method}($params);

    588.         }

    589.

    590.         // Store time and memory before and after hook call and save the result in the database

    591.         $time_start = microtime(true);

    592.         $memory_start = memory_get_usage(true);

 

    HookCore::coreCallHook - [line 544 - classes/Hook.php] - [3 Arguments]

 

    539.

    540.                 // Call hook method

    541.                 if ($hook_callable) {

    542.                     $display = Hook::coreCallHook($moduleInstance, 'hook'.$hook_name, $hook_args);

    543.                 } elseif ($hook_retro_callable) {

    544.                     $display = Hook::coreCallHook($moduleInstance, 'hook'.$retro_hook_name, $hook_args);

    545.                 }

    546.

    547.                 // Live edit

    548.                 if (!$array_return && $array['live_edit'] && Tools::isSubmit('live_edit') && Tools::getValue('ad')

    549.                     && Tools::getValue('liveToken') == Tools::getAdminToken('AdminModulesPositions'

 

    HookCore::exec - [line 205 - config/smarty.config.inc.php] - [3 Arguments]

 

    200.                 $id_module = $module->id;

    201.             }

    202.             unset($hook_params['mod']);

    203.         }

    204.         unset($hook_params['h']);

    205.         return Hook::exec($params['h'], $hook_params, $id_module);

    206.     }

    207. }

    208.

    209. function smartyCleanHtml($data)

    210. {

 

    smartyHook - [line - ] - [2 Arguments]

 

    Argument [0]

    Array

    (

        [h] => displayRightColumnProduct

    )

 

    Argument [1]

 

    call_user_func_array - [line 268 - config/smarty.config.inc.php] - [2 Arguments]

 

    263.                 } else {

    264.                     $args[] = &$arguments[$a];

    265.                 }

    266.             }

    267.

    268.             return call_user_func_array($item, $args);

    269.         }

    270.     }

    271.

    272.     public static function getInstance()

    273.     {

 

    SmartyLazyRegister->__call - [line 108 - cache/smarty/compile/74/d2/e2/74d2e22731a6736c086f9b546954e123745a5ed4.file.product.tpl.php] - [2 Arguments]

 

    103.   'unifunc' => 'content_5e8c67fd406306_33372802',

    104. ),false); /*/%%SmartyHeaderCode%%*/?>

    105. <?php if ($_valid && !is_callable('content_5e8c67fd406306_33372802')) {function content_5e8c67fd406306_33372802($_smarty_tpl) {?><?php if (!is_callable('smarty_function_cycle')) include '/home/emountab/public_html/tools/smarty/plugins/function.cycle.php';

    106. if (!is_callable('smarty_modifier_date_format')) include '/home/emountab/public_html/tools/smarty/plugins/modifier.date_format.php';

    107. ?><?php if ($_smarty_tpl->tpl_vars['tonytheme']->value['product_page_right_column']) {?>

    108.     <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'HOOK_RIGHT_COLUMN_PRODUCT', null); ob_start(); ?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->smartyHook(array('h'=>"displayRightColumnProduct"),$_smarty_tpl);?>

    109. <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);

    110. if (!empty($_capture_buffer)) {

    111.  if (isset($_capture_assign)) $_smarty_tpl->assign($_capture_assign, ob_get_contents());

    112.  if (isset( $_capture_append)) $_smarty_tpl->append( $_capture_append, ob_get_contents());

    113.  Smarty::$_smarty_vars['capture'][$_capture_buffer]=ob_get_clean();

 

    SmartyLazyRegister->smartyHook - [line 108 - cache/smarty/compile/74/d2/e2/74d2e22731a6736c086f9b546954e123745a5ed4.file.product.tpl.php] - [2 Arguments]

 

    103.   'unifunc' => 'content_5e8c67fd406306_33372802',

    104. ),false); /*/%%SmartyHeaderCode%%*/?>

    105. <?php if ($_valid && !is_callable('content_5e8c67fd406306_33372802')) {function content_5e8c67fd406306_33372802($_smarty_tpl) {?><?php if (!is_callable('smarty_function_cycle')) include '/home/emountab/public_html/tools/smarty/plugins/function.cycle.php';

    106. if (!is_callable('smarty_modifier_date_format')) include '/home/emountab/public_html/tools/smarty/plugins/modifier.date_format.php';

    107. ?><?php if ($_smarty_tpl->tpl_vars['tonytheme']->value['product_page_right_column']) {?>

    108.     <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'HOOK_RIGHT_COLUMN_PRODUCT', null); ob_start(); ?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->smartyHook(array('h'=>"displayRightColumnProduct"),$_smarty_tpl);?>

    109. <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);

    110. if (!empty($_capture_buffer)) {

    111.  if (isset($_capture_assign)) $_smarty_tpl->assign($_capture_assign, ob_get_contents());

    112.  if (isset( $_capture_append)) $_smarty_tpl->append( $_capture_append, ob_get_contents());

    113.  Smarty::$_smarty_vars['capture'][$_capture_buffer]=ob_get_clean();

 

    content_5e8c67fd406306_33372802 - [line 188 - tools/smarty/sysplugins/smarty_internal_templatebase.php] - [1 Arguments]

 

    183.                         }

    184.                         array_unshift($_template->_capture_stack, array());

    185.                         //

    186.                         // render compiled template

    187.                         //

    188.                         $_template->properties['unifunc']($_template);

    189.                         // any unclosed {capture} tags ?

    190.                         if (isset($_template->_capture_stack[0][0])) {

    191.                             $_template->capture_error();

    192.                         }

    193.                         array_shift($_template->_capture_stack);

 

    Smarty_Internal_TemplateBase->fetch - [line 110 - classes/SmartyCustom.php] - [7 Arguments]

 

    105.      * {@inheritDoc}

    106.      */

    107.     public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false)

    108.     {

    109.         $this->check_compile_cache_invalidation();

    110.         return parent::fetch($template, $cache_id, $compile_id, $parent, $display, $merge_tpl_vars, $no_output_filter);

    111.     }

    112.

    113.     /**

    114.      * {@inheritDoc}

    115.      */

 

    SmartyCustomCore->fetch - [line 713 - classes/controller/FrontController.php] - [1 Arguments]

 

    708.         ));

    709.

    710.         $layout = $this->getLayout();

    711.         if ($layout) {

    712.             if ($this->template) {

    713.                 $template = $this->context->smarty->fetch($this->template);

    714.             } else {

    715.                 // For retrocompatibility with 1.4 controller

    716.

    717.                 ob_start();

    718.                 $this->displayContent();

 

    FrontControllerCore->display - [line 19 - override/controllers/front/ProductController.php]

 

    14.             }

    15.             if (Module::isInstalled('smartshortcode') && (bool) Module::isEnabled('smartshortcode'))

    16.             {

    17.                    $this->product->description = smartshortcode::do_shortcode( $this->product->description );

    18.             }

    19.             return parent::display();

    20.      }

    21.     /*

    22.     * module: groupinc

    23.     * date: 2020-02-26 10:31:42

    24.     * version: 1.5.0

 

    ProductController->display - [line 209 - classes/controller/Controller.php]

 

    204.                     $this->{'displayAjax'.$action}();

    205.                 } elseif (method_exists($this, 'displayAjax')) {

    206.                     $this->displayAjax();

    207.                 }

    208.             } else {

    209.                 $this->display();

    210.             }

    211.         } else {

    212.             $this->initCursedPage();

    213.             $this->smartyOutputContent($this->layout);

    214.         }

 

    ControllerCore->run - [line 367 - classes/Dispatcher.php]

 

    362.             if (isset($params_hook_action_dispatcher)) {

    363.                 Hook::exec('actionDispatcher', $params_hook_action_dispatcher);

    364.             }

    365.

    366.             // Running controller

    367.             $controller->run();

    368.         } catch (PrestaShopException $e) {

    369.             $e->displayMessage();

    370.         }

    371.     }

    372.

 

    DispatcherCore->dispatch - [line 190 - override/classes/Dispatcher.php]

 

    185.     */

    186.     public function dispatch()

    187.     {

    188.         $o = Configuration::get('VIP_ADVANCED_URL_DISPATCHER');

    189.         if (!$o) {

    190.             parent::dispatch();

    191.             return;

    192.         }

    193.         $controller_class = '';

    194.         $this->getController();

    195.         if (!$this->controller) {

 

    Dispatcher->dispatch - [line 29 - index.php]

 

    24. *  @license    http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

    25. *  International Registered Trademark & Property of PrestaShop SA

    26. */

    27.

    28. require(dirname(__FILE__).'/config/config.inc.php');

    29. Dispatcher::getInstance()->dispatch();

Link to comment
Share on other sites

Did you contact the module author?
Unfortunately I do not have a module and look for a mistake in it is a long run.
No one will want to repair foreign modules and study how they work to help you find the fix.
Error in module.
Sorry, but unfortunately I will not help.

Link to comment
Share on other sites

26 minutes ago, Guest said:

Did you contact the module author?
Unfortunately I do not have a module and look for a mistake in it is a long run.
No one will want to repair foreign modules and study how they work to help you find the fix.
Error in module.
Sorry, but unfortunately I will not help.

Thx,

Regards

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...