ELGG 1.7.4: PHP-error_log warnings and a solution

Hello overyone,

we get the following errors in our php-error_log:

[Fri Nov 19 12:34:43 2010] [warn] [client XXX.XXX.XXX.XXX] mod_fcgid: stderr: PHP WARNING: 2010-11-19 12:34:43 (CET): "array_search() expects parameter 2 to be array, null given" in file engine/lib/metastrings.php (line 32)
[Fri Nov 19 12:34:43 2010] [warn] [client XXX.XXX.XXX.XXX] mod_fcgid: stderr: PHP WARNING: 2010-11-19 12:34:43 (CET): "Invalid argument supplied for foreach()" in file engine/lib/plugins.php (line 729)
[Fri Nov 19 12:34:43 2010] [warn] [clientXXX.XXX.XXX.XXX] mod_fcgid: stderr: PHP WARNING: 2010-11-19 12:34:43 (CET): "Invalid argument supplied for foreach()" in file engine/lib/database.php (line 111)

 

A first "solution" is

to add "if(!$DB_DELAYED_QUERIES) $DB_DELAYED_QUERIES = array();" before line 111 in /engine/lib/database.php,

add "if(!$ENABLED_PLUGINS_CACHE) $ENABLED_PLUGINS_CACHE = array();" before line 731 in /engine/lib/plugin.php and

add "if(!is_array($METASTRINGS_CACHE)) $METASTRINGS_CACHE = array();" before line 29 n /engine/lib/metastrings.php.

But for mit this could not be the final solution. Its more a short bugfix. Can you solve these warnings in the next ELGG-Version?

  • Hey,

    I've noticed these errors come up a lot on our installation as well.  They're pretty harmless, but annoying when you want to find something that's really wrong with your site.  Would you mind submitting it to Trac?

  • Hi,

    thanks for your answer. It is really annoying. Out error_log generates more than 15MB each day. So I will report it on trac.

    Best

  • Hi,

    I have similar (or the same?) warnings (like [Wed Sep 08 07:15:44 2010] [error] [client xxx.xx.x.xx] WARNING: 2010-09-08 07:15:44 (CEST): "parse_url(/pg/blog/group:610) [<a href='function.parse-url'>function.parse-url</a>]: Unable to parse URL" in file D:\\web\\htdocs\\engine\\lib\\elgglib.php (line 941)) and as I understood in Version 1.7.5 there is a fix for that. Can I integrate that without upgrading the rest. And if so, which file(s) would that be? Or can I just use the solution mentioned above?

    Thanks!