0

I have thousands errors in error_log file,there are large rows with one error :

PHP Notice: Undefined index: product in /home/ngya/public_html/modules/ps_sharebuttons/ps_sharebuttons.php on line 140

and the line 140 looks like :

140        $key = 'ps_sharebuttons|' . $params['product']['id_product'];

full code

139    {
140        $key = 'ps_sharebuttons|' . $params['product']['id_product'];
141        if (!empty($params['product']['id_product_attribute'])) {
142            $key .= '|' . $params['product']['id_product_attribute'];
143        }

After 00:00 at night, my time (now is 2 PM) I have at least 3555 errors of this kind. I get an error per second or every 15 seconds. Please help me!

Screen https://i.stack.imgur.com/6rUwS.jpg

  • Possible duplicate of [PHP: "Notice: Undefined variable", "Notice: Undefined index", and "Notice: Undefined offset"](https://stackoverflow.com/questions/4261133/php-notice-undefined-variable-notice-undefined-index-and-notice-undef) – TheDrot May 01 '18 at 11:16
  • You can add if(isset($params['product'])), before the line, can you add all function code? – tarek fellah May 02 '18 at 10:01

1 Answers1

0

change $params['product']['id_product'] to $_GET['id_product'].