mnethostid undefined

mnethostid undefined

by Bernie Dodge -
Number of replies: 1
I upgraded from Moodle 1.8.2 (I think) to 1.9.2 the other day and had to work through a few quirks caused by my not moving the uploaddata directory into the new Moodle before upgrading. Have got most of that worked out except for the Array thing on the page top breadcrumb trail. I can live with that.

However, today it emerged that when you try to do a mass mailing to participants, you get this error message:

Notice: Undefined property: mnethostid in /home/edwikie/public_html/moodle/lib/moodlelib.php on line 4096

I've checked the mdl_users and mdl_config tables to verify that mnethostid is being set to 1 in both places and all's well there.

It appears that the mail actually does go out, in spite of this error message.

Does anyone have an idea of where I should look to make this message go away?

TIA.

Average of ratings: -
In reply to Bernie Dodge

Re: mnethostid undefined

by Richard Enison -
BD,

Yes. First of all, it's not an error msg.; it's what it says it is, a notice. It just means that Moodle developers are taking advantage of the fact that PHP is not a strongly typed language. Unlike C, C++, java, and other such languages, in PHP you don't have to declare a function or class in advance, specifying exactly what its parameters, arguments, properties, and methods are and what type (integer, floating point number, text string, array, object, etc.) they are before using it. Which means that you can add a property (like mnethostid) to an object on the fly any time you want. You are seeing the notice because you have your error reporting level set to show notices. If you don't want to see them, change the reporting level in your active php.ini file, or in Moodle, Administration menu, Server submenu, set Debugging to MINIMAL (show fatal errors only) or NONE (no msgs.). There doesn't seem to be a way (in Moodle) to set it to show warnings but not notices. See http://docs.moodle.org/en/Debugging#Debug_messages.

RLE