Upgrade to 1.5 Showing Undefined Language Property

Upgrading to 1.5 today seems to have good (relatively) painlesslessly. I do have one issue though and I'm wondering if anyone else has encountered it and knows how to solve?

There's a message at the top of my screen that says

"Notice: Undefined property: stdClass::$language in /var/www/vhosts/ceiu-seic-dev.com/httpdocs/members/engine/lib/languages.php on line 87"

It also appears at the top of every widget. Things seem to be functoning correctly otherwise though I haven't dug too deeply yet. If anyone can explain that message, I'm all ears

  • This is a trivial PHP notice.

    You should turn off writing error messages to your screen and write them to your error log instead.

    And probably set the message threshhold to something higher than "Notice".

  • Thanks for that. It didn't appear to be causing anything icky but I wasn't sure.

  • Kevin, just a follow up here...how do I turn that off exactly? I assume this is a PHP thing and not an Elgg thing?

  • Usually it is turned off and in fact the Elgg .htaccess file forces it off with a

    php_value display_errors 0

    So I assumed that you had either commented that out or over-rode that setting in your php.ini file.

    Very strange if it is happening without your action.

    You can turn it off by putting

    display_errors 0

    in your php.ini file.

  • Kevin, thanks for that. I'll take a look.

  • This happened to me on upgrade as well.  I did intentionally turn on error display for trouble shooting some other modules.

    Although it is correct that turning off errors will "fix" the problem, it seems like the correct solution would be to have line 87 of /engine/lib/languages.php changed to:

    if ((!$language) && (isset($CONFIG->language)) && ($CONFIG->language))

    This would eliminate the generation of the notice and the isset() call would be consistant with other lines of code in the same file. For example line 31 and 114.

    Just my two cents worth...

  • Exactly, Dustin.

    It says something is wrong, or not good at least. Turning the notifications off is a workaround like plugging your ears or turning on the radio when your car makes strange sounds.

     

  • I think that the better way is to chage the script in "/engine/lib/languages.php".

    Line 87

    From

    if ((!$language) && (isset($CONFIG->language)) && ($CONFIG->language))

    To

    if ((!$language) && (isset($CONFIG->language)) && ($CONFIG->language))

    By http://howgoodtouse.com