You are here:  » PHP error message: Undefined index: index.php...


PHP error message: Undefined index: index.php...

Submitted by kveenbaas on Thu, 2018-01-25 19:54 in

I get a constant error message in my Wordpress error log:

Undefined index: index.php?pagename=/shopping/&pto_module=merchant in /home/opfiet1q/public_html/wp-content/plugins/pto/pto.php on line 448

What can solve the issue?

The line 448 contains:

($rules[$k] <> $rules[$v])

In the whole set of code:

{code saved}

Submitted by support on Fri, 2018-01-26 09:03

Hi,

If you REPLACE with:

(!isset($rules[$v])) || ($rules[$k] <> $rules[$v])

That should clear any warnings - I'll double check this in the distribution.

Cheers,
David.
--
PriceTapestry.com

Submitted by kveenbaas on Fri, 2018-01-26 14:00

Thank you David, the message is gone.
Still I do have the PHP message, which I thought it was related to the meaasge before, since it came also every second. Nevertheless this message still appears, do you know what the orignin is? Or should I generally update the software to the latest release? I know that I changed some minor items in th epast, but did not comment them, so I'm a bit hesitative.

This is the error message (in dutch) I receive every second.

[26-Jan-2018 13:53:24 UTC] PHP Notice: De aangeroepen constructiemethode voor WP_Widget in pto_atoz_widget is niet meer in gebruik sinds versie 4.3.0. Gebruik in plaats daarvan: __construct(). in /home/opfiet1q/public_html/wp-includes/functions.php on line 3902

Submitted by support on Fri, 2018-01-26 14:59

Hi,

This is down to deprecated object constructor format which I will incorporate into the beta distribution, in the mean time you can patch as follows;

(if you only use the A to Z widget, you would only need to make the changes to pto_atoz.php)

Edit pto_atoz.php and look for the following code at line 171:

  function pto_atoz_widget()
  {
    parent::WP_Widget(false, $name = "PriceTapestry.org A to Z");
  }

...and REPLACE with:

  function __construct()
  {
    parent::__construct(false, $name = "PriceTapestry.org A to Z");
  }

Edit pto_featured.php and look for the following code at line 222:

  function pto_featured_widget()
  {
    parent::WP_Widget(false, $name = "PriceTapestry.org Featured Products");
  }

...and REPLACE with:

  function __construct()
  {
    parent::__construct(false, $name = "PriceTapestry.org Featured Products");
  }

Edit pto_search.php and look for the following code at line 1012:

  function pto_search_widget()
  {
    parent::WP_Widget(false, $name = "PriceTapestry.org Search");
  }

...and REPLACE with:

  function __construct()
  {
    parent::__construct(false, $name = "PriceTapestry.org Search");
  }

And then the following code at line 1075:

  function pto_search_filters_widget()
  {
    parent::WP_Widget(false, $name = "PriceTapestry.org Search Filters");
  }

...and REPLACE with:

  function __construct()
  {
    parent::__construct(false, $name = "PriceTapestry.org Search Filters");
  }

Cheers,
David.
--
PriceTapestry.com

Submitted by kveenbaas on Fri, 2018-01-26 18:46

Thank you David, this worked out for me as well. Now the whole bunch of error messages is gone, The only one I see now, still coming by is:

[26-Jan-2018 17:50:17 UTC] PHP Notice: Undefined variable: html in /home/opfiet1q/public_html/wp-content/plugins/pto/pto_product.php on line 538

Micht you have a solution for this as well?

Thnx in advance.

Submitted by support on Sat, 2018-01-27 09:10

Hi,

Ah - that would occur if using prices shortcode - $html should be initialised at the top of the pto_product() function. To add this, look for the following code at line 386:

  pto_product_query();

...and REPLACE with:

  pto_product_query();
  $html = ";

Cheers,
David.
--
PriceTapestry.com