moodle-tool_mergeusers icon indicating copy to clipboard operation
moodle-tool_mergeusers copied to clipboard

Merge User Accounts error

Open dragos5436 opened this issue 1 year ago • 1 comments

Hi there,

We are trying to merge two user accounts, but are getting the following error: image

Any tips on what the problem might be and what we could do about it? We suspect there is something related to this particular account, as we are able to merge different sets of accounts, so nothing wrong with the merge process itself.

Thanks

Moodle version 4.3.3 PHP version 8.0

dragos5436 avatar Feb 21 '24 16:02 dragos5436

Hi @dragos5436 ,

It seems that you have some kind of inconsistence in your database.

It tries to regrade a certain activity of type "attendance", which nowadays it does not exist anymore. Maybe it is something related to the plugin type or maybe of your Moodle instance.

We have the plugin "attendance" in production, and we never have seen this kind of error.

If it was me, I would investigate on the database to find where this instance appears and try to do some cleanup or fixing of the database records.

It is something outside the scope of this plugin. This plugin cannot afford about database inconsistences, since for certain tasks, it involves the use of Moodle core APIs, as in this case for regrading, and cannot do anything else.

Maybe in the future, it could be handled this exception to pass to the next item to regrade, but it feels to me to provide false sensation of sucess.

Above all, it is not related to this plugin, but to your Moodle database consistence of data.

Thanks for contacting.

Jordi

jpahullo avatar Feb 22 '24 08:02 jpahullo

Thank you for the help Jordi, we have now managed to complete the merge. We believe some module cleanup task might have got stuck and failed to delete the problematic modules, which was preventing the merge process from running correctly.

Kind regards,

Dragos

dragos5436 avatar Apr 30 '24 12:04 dragos5436

Good to know you finally merged those users.

Thank you for your feedback. It is much apreciated.

Thanks,

Jordi

jpahullo avatar May 06 '24 13:05 jpahullo