Comment 1 for bug 1239451

Revision history for this message
Aaron Wells (u-aaronw) wrote :

One commenter noted that the problem resolved when they changed lib/mahara.php's get_string_from_file() method so that on line 783 instead of "include ($langfile);" it calls "include_once($langfile);". This would be generally consistent with the error -- if the file is getting included twice, then the function will attempt to be defined twice, throwing this exact error.

The only strange thing is that the include statement is inside an if() block that should prevent it from being executed twice. There's a static $strings variable, and it stores the results of including the language file, and it before loading the language file it checks to see if it is already holding contents for it. So it doesn't make sense that the include() is happening more than once, unless there's some code that can clear out that static $strings, or if its check for whether it has loaded the file before, is not working properly.