Page 1 of 1

[2.0] Spartacus error message

Posted: Fri Jan 02, 2015 5:15 pm
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

Re: [2.0] Spartacus error message

Posted: Fri Jan 02, 2015 5:36 pm
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)
?

Re: [2.0] Spartacus error message

Posted: Fri Jan 02, 2015 5:45 pm
by yellowled
Timbalu wrote:

Code: Select all

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

YL

Re: [2.0] Spartacus error message

Posted: Fri Jan 02, 2015 6:16 pm
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.

Re: [2.0] Spartacus error message

Posted: Sat Jan 03, 2015 9:37 am
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

Re: [2.0] Spartacus error message

Posted: Mon Jan 05, 2015 12:45 pm
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

Re: [2.0] Spartacus error message

Posted: Thu Jan 08, 2015 2:19 pm
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.

Re: [2.0] Spartacus error message

Posted: Fri Jan 09, 2015 12:23 pm
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

Re: [2.0] Spartacus error message

Posted: Fri Jan 09, 2015 6:34 pm
by yellowled
Someone make a GitHub issue so we don't forget about it?

YL

Re: [2.0] Spartacus error message

Posted: Sat Jan 10, 2015 4:28 pm
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.

Re: [2.0] Spartacus error message

Posted: Mon Jan 12, 2015 12:51 pm
by garvinhicking
Hi Timbalu,

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

Regards,
Garvin