Error in bulk user actions - delete users

Error in bulk user actions - delete users

by Gus Hagelberg -
Number of replies: 7
When I try to delete users in bulk user actions (the number of users doesn't seem to matter) I get the following error message:
The instance of this module does not exist The instance of this module does not exist 
Notice: Undefined variable: CFG in /home/relax/htdocs/moodle/admin/user/lib.php on line 3

Notice: Trying to get property 'dirroot' of non-object in /home/relax/htdocs/moodle/admin/user/lib.php on line 3

Warning: require_once(/user/filters/lib.php): failed to open stream: No such file or directory in /home/relax/htdocs/moodle/admin/user/lib.php on line 3

Fatal error: require_once(): Failed opening required '/user/filters/lib.php' (include_path='/home/relax/htdocs/moodle/lib/pear:.:/usr/share/php') in /home/relax/htdocs/moodle/admin/user/lib.php on line 3


------
Moodle Versions: 3.11.10 and 4.0.4
OS: Debian 4.19.249-2 
PHP: 7.3.31
mariadb (5.5.5-10.3.34-MariaDB-0+deb10u1)

Average of ratings: -
In reply to Gus Hagelberg

Re: Error in bulk user actions - delete users

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Here's user/lib.php for Moodle 4.0.4

https://github.com/moodle/moodle/blob/v4.0.4/user/lib.php

As you can see, there is no CFG or reference to including any file on line 3. It's just license boilerplate. So, what does your user/lib.php file look like in the first few lines?
In reply to Gus Hagelberg

Re: Error in bulk user actions - delete users

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

Try enabling debugging. Hopefully this will include more detailed error output.

In reply to Leon Stringer

Re: Error in bulk user actions - delete users

by Gus Hagelberg -
Leon is correct: its admin/user/lib.php

I had debugging set to "ALL". With debugging set to "DEVELOPER" the error message is the same
In reply to Gus Hagelberg

Re: Error in bulk user actions - delete users

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

Can you give us precise steps that cause the error on your site?

And can you tell us what the first few lines of config.php say? It should be something like:

<?php  // Moodle configuration file

unset($CFG);
global $CFG;
$CFG = new stdClass();
In reply to Leon Stringer

Re: Error in bulk user actions - delete users

by Gus Hagelberg -
Here are the first 10 lines of my config.php <?php // Moodle configuration file

unset($CFG);
global $CFG;
$CFG = new stdClass();

$CFG->dbtype = 'mariadb';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle';