Moodle 3.9 Error Deleting Users

Moodle 3.9 Error Deleting Users

sean young -
回帖数:4

Hi all,

I've upgraded to Moodle 3.9+ and am experiencing an issue deleting users. I am unclear whether this is as a result of the upgrade or not (I did not encounter the issue before upgrading, but have not tried recently).

When trying to delete a user that has been enrolled on the site for some time, I get the following errors.

The screenshot below is taken from a local development clone of the site, but the same issue is happening on my production site.

 

If I create a new user, and then delete it straight away, this works fine.

Can anybody help?

回复sean young

Re: Moodle 3.9 Error Deleting Users

Ken Task -
Particularly helpful Moodlers的头像

Upgraded from what version to 3.9+?

What is sites theme?   If something other than the themes that came with the 3.9 code (boost,classic) change the theme to either boost or classic.   See what happens.

'SoS', Ken


回复Ken Task

Re: Moodle 3.9 Error Deleting Users

sean young -
Hi Ken,

Thanks for your advice.

I was running 3.8+ before.

The theme was Edwiser RemUI, which has been updated for Moodle 3.9. I did as you suggested and switched the theme to Classic, but this resulted in the same error.

I came across this in the tracker, which has apparently be resolved. It suggested a workaround as manually deleting orphaned data, but my knowledge doesn't extend as far as knowing how to do this safely.
https://tracker.moodle.org/browse/MDL-51694
回复sean young

Re: Moodle 3.9 Error Deleting Users

Ken Task -
Particularly helpful Moodlers的头像

Well, it was a stab! :|

Tracker says fixed for 3.7.6 and for 3.8.3.
Your site 3.8+ ... just missed it, I guess.

Confirmed ...
11 step process via Moodle Admin GUI Interface, but also noted there:
a 'work-around' ... Manually delete orphaned records in grade_grades which you have also noted. I, like you, would pursue the 'work-around'! 微笑

So now the quest is how to find 'orphaned records' in grade_grades table.

'Safely' ... begins with making a backup of database and knowing how to restore that backup DB to a new DB and changing config.php to point to the restored DB.

Then ...
can you use whatever tool you have for interacting with DB, to id 'orphaned records' in grade_grades table?

mysql> explain mdl_grade_grades;
+-------------------+---------------+------+-----+-----------+----------------+
| Field             | Type          | Null | Key | Default   | Extra          |
+-------------------+---------------+------+-----+-----------+----------------+
| id                | bigint(10)    | NO   | PRI | NULL      | auto_increment |
| itemid            | bigint(10)    | NO   | MUL | NULL      |                |
| userid            | bigint(10)    | NO   | MUL | NULL      |                |
| rawgrade          | decimal(10,5) | YES  |     | NULL      |                |
| rawgrademax       | decimal(10,5) | NO   |     | 100.00000 |                |
| rawgrademin       | decimal(10,5) | NO   |     | 0.00000   |                |
| rawscaleid        | bigint(10)    | YES  | MUL | NULL      |                |
| usermodified      | bigint(10)    | YES  | MUL | NULL      |                |
| finalgrade        | decimal(10,5) | YES  |     | NULL      |                |
| hidden            | bigint(10)    | NO   |     | 0         |                |
| locked            | bigint(10)    | NO   | MUL | 0         |                |
| locktime          | bigint(10)    | NO   |     | 0         |                |
| exported          | bigint(10)    | NO   |     | 0         |                |
| overridden        | bigint(10)    | NO   |     | 0         |                |
| excluded          | bigint(10)    | NO   |     | 0         |                |
| feedback          | longtext      | YES  |     | NULL      |                |
| feedbackformat    | bigint(10)    | NO   |     | 0         |                |
| information       | longtext      | YES  |     | NULL      |                |
| informationformat | bigint(10)    | NO   |     | 0         |                |
| timecreated       | bigint(10)    | YES  |     | NULL      |                |
| timemodified      | bigint(10)    | YES  |     | NULL      |                |
| aggregationstatus | varchar(10)   | NO   |     | unknown   |                |
| aggregationweight | decimal(10,5) | YES  |     | NULL      |                |
+-------------------+---------------+------+-----+-----------+----------------+

orphaned ... means no data tied to userid?  User doesn't exist in system?

so if one ran this:

select id,itemid,userid from mdl_grade_grades;

and in data returned there was a row that contained no data in userid column?

Sorry ... ain't a DB admin guru! :|   Anyone?

'SoS', Ken