jpahullo / moodle-tool_mergeusers

Merge users script for Moodle

Home Page:https://moodle.org/plugins/view.php?plugin=tool_mergeusers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

im installed Merge user accounts 3.9 version, but when i merge two contacts it showing this bellow error message. can you guys help me to resolve this ?

Sathish323 opened this issue · comments

Hi @Sathish323 ,

All Moodle tables have an id column, by design.

This error says that you have some Moodle table without such a column. You should review which table or tables do not have a column with name id. It used to be plugins for your own institution or third party plugins that do not follow Moodle standards.

When you find these tables (one or more tables), one of these situations may arise per table:

  1. Table has no user.id related field, so it can be excluded from merging process.
  2. Table has user.id related field.

The easy case is the first case, and you could go ahead by creating or modifying your own mergeusers/config/config.local.php file with the table name included in a structure like https://github.com/jpahullo/moodle-tool_mergeusers/blob/master/config/config.php#L42C5-L42C17

<?php
defined("MOODLE_INTERNAL") || die();

return [
    'exceptions' => [
        'your_table_name_to_exclude_from_processing_by_mergeusers',
    ],
];

If your case is the second one, it is more complicated. I think you can do something like the above, excluding the table that does not have id column, and then implement an observer for the success merging event, and then proceed with the change of ids as we do within this plugin.

In the end, it is something related to your instance and the plugins and tables you have in your Moodle instance.

Thanks for reporting,

Jordi