Weird error message when installing Extended entries

Creating and modifying plugins.
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Weird error message when installing Extended entries

Post 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
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Weird error message when installing Extended entries

Post 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... ;-)
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: Weird error message when installing Extended entries

Post 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
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Weird error message when installing Extended entries

Post 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?
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: Weird error message when installing Extended entries

Post 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
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Weird error message when installing Extended entries

Post by Timbalu »

Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Weird error message when installing Extended entries

Post by Timbalu »

Did you already run that, YL?
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: Weird error message when installing Extended entries

Post by yellowled »

No. Sorry, I completely forgot about that and deleted the test blog (which was only set up for one purpose anyway). :(

YL
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Weird error message when installing Extended entries

Post 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
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Weird error message when installing Extended entries

Post 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();
    }
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: Weird error message when installing Extended entries

Post by garvinhicking »

Hi!

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

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: Weird error message when installing Extended entries

Post 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
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Weird error message when installing Extended entries

Post by Timbalu »

Hee hee, you are advancing to our official 'php5 coding' investigator... :lol:
No need for full log. Fixed! Please dig on. ...
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Post Reply