Exception - Call to undefined function course_overviewfiles_options()

Exception - Call to undefined function course_overviewfiles_options()

by André Domingues -
Number of replies: 6

I'm getting the following error 
Call to undefined function course_overviewfiles_options()

This error is resolved by clearing the cache, but after clearing the cache the error appears 
Exception - Call to undefined function core_login_get_return_url()

After clearing the cache again the first error returns after a short time

Average of ratings: -
In reply to André Domingues

Re: Exception - Call to undefined function course_overviewfiles_options()

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

Enable debugging to get more details with these errors, what do they say?

In reply to Leon Stringer

Re: Exception - Call to undefined function course_overviewfiles_options()

by André Domingues -
Moodle 4.2.3, PHP 8

This error msg

Rastreamento de pilha: 
  • line 231 of /login/index.php: Error thrown
The line 
        $urltogo = core_login_get_return_url();

In reply to André Domingues

Re: Exception - Call to undefined function course_overviewfiles_options()

by Ken Task -
Picture of Particularly helpful Moodlers
php 8.0 or 8.1 or 8.2 or 8.3 or 8.4?
Devils are in the details! smile

In config.php file, wwwurl ... is http or https ...?

What's in:
admin/settings.php?section=blocksettingmyoverview
of your site?

'SoS', Ken

In reply to André Domingues

Re: Exception - Call to undefined function course_overviewfiles_options()

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

Are you certain it's Moodle 4.2.3? Because on line 231 of /login/index.php for all versions of Moodle 4.2.x is a comment with the line you reference on line 229:

229         $urltogo = core_login_get_return_url();
230
231     /// check if user password has expired

This difference in line numbers suggests you either have at least 1 source code files from different versions of Moodle, or that your /login/index.php has been modified. Make sure you have the correct source code files for the expected version of Moodle.

Also, the correct /login/index.php contains:

 28 require_once('lib.php');
 which loads the file containing the definition for core_login_get_return_url() so there should never be a Call to undefined function core_login_get_return_url() error.

In reply to Leon Stringer

Re: Exception - Call to undefined function course_overviewfiles_options()

by André Domingues -
Yes, is moodle 4.2.3.
PHP 8.0

The error message points to the line mentioned above.

No Moodle files were modified during or after installation to avoid any errors.

The error
Exception - Call to undefined function core_login_get_return_url()
disappears for a few minutes after clearing the cache, but this leads to the error
Call to undefined function course_overviewfiles_options()
which disappears when the cache is cleared and the core_login_get_return_url error comes up again.

Require('lib.php'); remains in login.php normally, as it was not modified at any time
In reply to André Domingues

Re: Exception - Call to undefined function course_overviewfiles_options()

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers
So PHP is reporting Call to undefined function on a line containing a comment? I think the next step would be to update to Moodle 4.2.6 (the latest 4.2.x version) to make sure you have all available fixes. If the problem still occurs we'll try to come up with more suggestions.