Page 1 of 1

Weird error message when installing Extended entries

Posted: Mon Sep 24, 2012 4:28 pm
by yellowled
So I just set up a dev blog on my Uberspace server. When I installed the Extended Entries plugin via Spartacus, I got a weird error message:

Code: Select all

== TESTING ERROR MODE ==

Array
(
    [0] => 2
    [1] => Invalid argument supplied for foreach()
    [2] => /var/www/virtual/xxxxx/sub.domain.tld/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php
    [3] => 631
    [4] => Array
[--- loooooots and lots of code ---]
)

Fatal error: Uncaught exception 'ErrorException' with message 'Serendipity error: Invalid argument supplied for foreach()' in /var/www/virtual/xxxxx/sub.domain.tld/include/compat.inc.php:108
Stack trace:
#0 /var/www/virtual/xxxxx/sub.domain.tld/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php(631): errorToExceptionHandler(2, 'Invalid argumen...', '/var/www/virtua...', 631, Array)
#1 /var/www/virtual/xxxxx/sub.domain.tld/include/plugin_api.inc.php(1073): serendipity_event_entryproperties->event_hook('backend_cache_e...', Object(serendipity_property_bag), 'Erweiterte Eige...', NULL)
#2 /var/www/virtual/xxxxx/sub.domain.tld/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php(130): serendipity_plugin_api::hook_event('backend_cache_e...', 'Erweiterte Eige...')
#3 /var/www/virtual/xxxxx/sub.domain.tld/include/plugin_api.inc.php(171): serendipity_event_entryproperties->install()
#4 /var/www/virtual/xxxxx/sub.domain.tld/incl in /var/www/virtual/xxxxx/sub.domain.tld/include/compat.inc.php on line 108
The full error log is available at https://dl.dropbox.com/u/691134/extende ... -error.txt, but beware! – it's 2.600 lines. You've been warned. (Yes, it's anonymized.)

When I got back to the admin backend, I saw that the plugin seems to be installed properly, however. :shock:

YL

Re: Weird error message when installing Extended entries

Posted: Mon Sep 24, 2012 4:42 pm
by Timbalu
Invalid argument supplied for foreach() entryproperties line 631

Code: Select all

                    foreach($entries AS $idx => $entry) {
                        $this->updateCache($entry);
                    }
Please take a ride and change that to

Code: Select all

if (is_array($entries) && !empty($entries)) { ... the code before... }
The huge error output is based to a previous change to the serendipity error handler to output even more I allowed when coding it... ;-)

Re: Weird error message when installing Extended entries

Posted: Mon Sep 24, 2012 4:49 pm
by yellowled
Please be a little more verbose in your code examples. I have no idea^W^W^Wbarely managed to find out what to change to what here. (Okay, changed it.)

Shouldn't this be changed in the GitHub repo so I can install it again to test it or something? How do we find out if this fixes anything? The plugin seemed to be working fine before I changed anything.

YL

Re: Weird error message when installing Extended entries

Posted: Mon Sep 24, 2012 5:51 pm
by Timbalu
???
If that fixes the error not having any entries yet, it would be good to update the plugin on Github too.
Is that what you said?

Re: Weird error message when installing Extended entries

Posted: Mon Sep 24, 2012 5:56 pm
by yellowled
What I meant:

I installed the plugin, got said error message, but nevertheless the plugin installation went through. The error did not keep the plugin from installing, and it appeared to be working fine. So editing the installed plugin's php file doesn't really "test" anything. I have no idea if the modified php file makes the plugin work any better or if the changes solve whatever causes said error message.

So from my point of view (not being a programmer) it would make sense to update the plugin in GitHub, uninstall it and install it again to see if the changes actually solve the issue. But maybe that's not how you programmer's work. No idea.

YL

Re: Weird error message when installing Extended entries

Posted: Mon Sep 24, 2012 6:12 pm
by Timbalu

Re: Weird error message when installing Extended entries

Posted: Tue Oct 02, 2012 3:52 pm
by Timbalu
Did you already run that, YL?

Re: Weird error message when installing Extended entries

Posted: Tue Oct 02, 2012 4:11 pm
by yellowled
No. Sorry, I completely forgot about that and deleted the test blog (which was only set up for one purpose anyway). :(

YL

Re: Weird error message when installing Extended entries

Posted: Thu Oct 04, 2012 5:34 pm
by yellowled
Caught another one, this time trying to edit the freetags sidebar plugin config:

Code: Select all

== TESTING ERROR MODE ==

Array
(
    [0] => 2048
    [1] => Non-static method serendipity_event_freetag::install() should not be called statically, assuming $this from incompatible context
    [2] => /var/www/virtual/xxxxx/sub.domain.tld/plugins/serendipity_event_freetag/serendipity_plugin_freetag.php
    [3] => 232
    [4] => Array
Plugin configuration changes were submitted anyway.

Full log: https://dl.dropbox.com/u/691134/freetag ... -error.txt

YL

Re: Weird error message when installing Extended entries

Posted: Thu Oct 04, 2012 6:30 pm
by Timbalu
Strange!
Is a class::method() call a static call in this case?

Code: Select all

    function cleanup() {
        global $serendipity;

        serendipity_event_freetag::install();
    }

Re: Weird error message when installing Extended entries

Posted: Fri Oct 05, 2012 8:43 am
by garvinhicking
Hi!

Thanks for noticing...indeed the function is not marked as "static", I just committed a change to git.

Regards,
Garvin

Re: Weird error message when installing Extended entries

Posted: Tue Oct 09, 2012 7:20 pm
by yellowled
… and another one. This pops up when calling the “newly discovered” /commens/ url in 1.7-alpha1:

Code: Select all

== TESTING ERROR MODE ==

Array
(
    [0] => 2048
    [1] => Only variables should be assigned by reference
    [2] => /var/www/virtual/xxxxx/sub.domain.tld/include/functions_comments.inc.php
    [3] => 487
    [4] => Array
Someone give me a hint if you guys need a full log to debug this, please.

YL

Re: Weird error message when installing Extended entries

Posted: Tue Oct 09, 2012 7:34 pm
by Timbalu
Hee hee, you are advancing to our official 'php5 coding' investigator... :lol:
No need for full log. Fixed! Please dig on. ...