Uncaught Error: Call to undefined function current_language()

Uncaught Error: Call to undefined function current_language()

by Israel Forés -
Number of replies: 2

Hi,

We have had a problem with 500 error code in our servers. 


[18-Jul-2021 17:01:45 Europe/Madrid] PHP Fatal error:  Uncaught Error: Call to undefined function current_language() in /html/lib/setuplib.ph

Stack trace:

#0 /html/lib/setuplib.php(560): get_docs_url()

#1 /html/lib/setuplib.php(351): get_exception_info(Object(ParseError))

#2 [internal function]: default_exception_handler(Object(ParseError))

#3 {main}

  thrown in /html/lib/setuplib.php on line 701

[18-Jul-2021 17:01:48 Europe/Madrid] PHP Fatal error:  Uncaught Error: Call to undefined function current_language() in /html/lib/setuplib.php

The version of our php is 7.2.24

At the end we have recovered the services by cleaning cache directories:

  • cache
  • trashdir
  • temp

Someone with the same problem could explain why we have fixed the problem by remove those directories?

Thanks in advance

Israel Forés.


(Edited by Helen Foster to remove paths - original submission Wednesday, 21 July 2021, 2:05 PM)

Average of ratings: -
In reply to Israel Forés

Re: Uncaught Error: Call to undefined function current_language()

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

What version of Moodle is this? There was a bug in 3.7 and earlier, MDL-65996, where an error early on in Moodle's initialisation could lead to this unrelated message because of a bug in Moodle's error handling.

So if you do have Moodle 3.7 or earlier then you should upgrade.

But if you have a currently supported Moodle version and this problem happens again then you may need to comment out the calls to get_docs_url() and debugging() as described in MDL-65996's description to see to root cause.

In reply to Leon Stringer

Re: Uncaught Error: Call to undefined function current_language()

by Israel Forés -
Hello Leon,

Sorry I forgot to notify the moodle version. Our version is 3.5, I'm going to check MDL-65996.

Thanks for the info. I haven't find this info in my research, I only find info about the php version.

Thanks again and have a good day
Israel forés