[2.0] Spartacus error message

Found a bug? Tell us!!
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

[2.0] Spartacus error message

Post by yellowled »

When updating either sidebar or event plugins in 2.0, I get:

Code: Select all

== TESTING ERROR MODE ==


Fatal error:  Uncaught exception 'ErrorException' with message 'Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context' in /var/www/virtual/user/html/include/compat.inc.php:126
Stack trace:
#0 /var/www/virtual/user/html/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php(399): errorToExceptionHandler(8192, 'Non-static meth...', '/var/www/virtua...', 399, Array)
#1 /var/www/virtual/user/html/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php(581): serendipity_event_spartacus->fetchfile('http://netmirro...', '/home/user/html...', 43200, true)
#2 /var/www/virtual/user/html/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php(1168): serendipity_event_spartacus->fetchOnline('sidebar')
#3 /var/www/virtual/user/html/include/plugin_api.inc.php(1138): serendipity_event_spartacus->event_hook('backend_plugins...', Object(serendipity_property_bag), Array, NULL)
#4 /var/www/virtual/user/html/include/admin/plugins.inc.php(159): serendipi in /var/www/virtual/user/html/include/compat.inc.php on line 126
s9y 2.0-rc2, Spartacus 2.31, PHP 5.6.3

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Spartacus error message

Post by Timbalu »

What happens if you change https://github.com/s9y/Serendipity/blob ... R.php#L257
to

Code: Select all

  static function isError($data, $code = null)
?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: [2.0] Spartacus error message

Post by yellowled »

Timbalu wrote:

Code: Select all

static function isError($data, $code = null)
With that line edited that way, updating plugins works.

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Spartacus error message

Post by Timbalu »

I am not sure we are allowed to do this. It seems to be legacy from PHP 4 times and could also be suppressed by error_reporting = E_ALL & ~E_STRICT..., which is already the default for $serendipity['production'] releases.

The newer PEAR 1.9.5 file has a PEAR5.php wrapper for such puposes, I think.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: [2.0] Spartacus error message

Post by yellowled »

Timbalu wrote:The newer PEAR 1.9.5 file has a PEAR5.php wrapper for such puposes, I think.
So we would need to update the bundled PEAR? Or do I need to update PEAR on my server/web space?

YL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] Spartacus error message

Post by garvinhicking »

Hi!

Strange is that it's a FATAL error, however it would only be a notice.

Anyhow. I think we need to patch that as a static function due to our use of error handling. Committed to github.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Spartacus error message

Post by Timbalu »

Garvin, there seems to be even more to do ..., raiseError() and maybe setErrorHandling()...

Former very old PEAR.php,v 1.83 had the static set for isError() and raiseError() methods, until Mattsches updated it to 1.9.4, which removed the static, when he commited https://github.com/s9y/Serendipity/comm ... 184246052e
which was discussed here
http://board.s9y.org/viewtopic.php?f=11 ... t=Request2
The PEAR devs seemed to have decided to not set these methods as static.

I don't really get why we did not change to Request2 etc yet, that we now had to fix the static again https://github.com/s9y/Serendipity/comm ... 102b69d28b

It would be nice to switch to or use a general wrapper using Request2 and all the others xx2 includes at least with PHP >= 5.5+ versions, since they are designed to work different.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] Spartacus error message

Post by garvinhicking »

OK, so I think we should mark the functions as static again.

As for Request2,I believe the syntax has changed so we'd definitely need a specific wrapper for that. Not sure what we exactly need to do.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: [2.0] Spartacus error message

Post by yellowled »

Someone make a GitHub issue so we don't forget about it?

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Spartacus error message

Post by Timbalu »

garvinhicking wrote:Strange is that it's a FATAL error, however it would only be a notice.
This is because most E_STRICT errors are thrown during the page's compilation process and can not be suppressed at runtime, I assume.

At all, I suggest we should now use E_ALL as if Serendipity 2.0 was for 5.4+ only. The few 5.3 instances out there shall live with it for the few month they will still use a 5.3. And of course this would only hit them with a wrong bitmask in case they would run into E_STRICT errors in production mode 'debug' or testing.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] Spartacus error message

Post by garvinhicking »

Hi Timbalu,

ok which patch would you propose?! Maybe I can understand then.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply