Comments (9)
Hi!
Thanks for the feedback @fernandezalerrt .
Which version of the plugin are you using?
We are using this plugin in our production site without any error.
On https://moodle.org/plugins/tool_mergeusers/versions you can see a specific version for Moodle 4.1, and it is not the last version. Have you checked that? If you are using this git repo to get it, it is related to the branch MOODLE_401_STABLE of this repo.
If it still applies this error, please, enable developer debug level, and paste here the trace of the error.
Thanks,
Jordi
PD: I think you have contacted me privately on moodle.org. This issue is more relevant for this kind of thinkgs. Thanks again for contacting.
from moodle-tool_mergeusers.
from moodle-tool_mergeusers.
from moodle-tool_mergeusers.
from moodle-tool_mergeusers.
Hi,
Thanks for the feedback and the effort for providing it.
However, if it was caused by a cache issue during upgrade or installation, it is just that.
Regarding your important question:
Is there a way I can execute the plugin via API?
Our principal users' database is in another web, I want to merge users in
Moodle when I merge users in the principal database.
Yes, you can.
How? The answer is a bit longer than before, hehe.
It is documented on the README.md:
https://github.com/jpahullo/moodle-tool_mergeusers#command-line-script
And this is what we have implemented in our institution to have an unattended merging process every day.
The idea behind the Gathering
interface is that it provides the list of merging actions to perform. You can implement it, in your case, for instance, accessing to an external database (infrastructure and firewalling issues are on your hands), or getting the list of merging actions from a REST API that you can get from the Moodle side. So, in summary, your Gathering
implementation, say FernandezGathering
is the reponsible to provide the list of action. The how?
is what you have to implement in your new class.
Following the above example, you would have:
- A new file inside this plugin, in your Moodle (do not contribute it, if it is something specific for you), like
admin/tool/mergeusers/lib/FernandezGathering.php
. - Add or edit the configuration file
admin/tool/mergeusers/config/config.local.php
with something like:
<?php
return array(
// gathering tool
'gathering' => 'FernandezGathering',
);
- Add the cli script
admin/tool/mergeusers/cli/climerger.php
into the crontab of your server, as often as you consider. We have it in our institution once a day, according to the rest of corporate processes.
And mainly, this is all! The big effort for you is to analyse if you can build the list of merging actions from a FernandezGathering.php
from the Moodle side. And if so, implement it. When implementing it, given that the plugin expects user.ids, you will have to translate inside the FernandezGathering
the external username/idnumber/whatever to a Moodle user.id, and provide the source id (to remove) and the target id (to keep).
As an example, we have implemented it in our institution by asking the list from an external database. So, it is possible. In that implementation, we also consider edge cases, like users not found yet on Moodle and so, informing why the merging action is not being performed right now. Actually, our implementation also consider a number of attempts to retry the merging actions. It is all in your hands. Here, the important thing is to keep the order of the merging action list. Since edge cases my arise, like from A to B, later B to C, and later C to A. These merging actions in a different order will produce a different result. In that case, the final user (the person with that username) will not get the whole Moodle content/activit/etc under its user profile or may not know which is the actual username to use each time.
Thanks for contacting,
Jordi
from moodle-tool_mergeusers.
from moodle-tool_mergeusers.
The same to you @fernandezalerrt !
from moodle-tool_mergeusers.
By the way, @fernandezalerrt ,
The last, but not the least: a merging action is an idempotent operation. That means that if you repeat the same operation a second time, a third time, from the same two user ids, the result will be the same. This is why we added retries on our Gathering implementation. The only difference my appear on the actions being done inside every merging action: while the first one will contain a bunch of operations, the second one and the others, should contain almost nothing.
Thanks,
Jordi
from moodle-tool_mergeusers.
from moodle-tool_mergeusers.
Related Issues (20)
- FR: Option to skip over orphan grades HOT 3
- 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 ? HOT 1
- O365 error login HOT 1
- Potential coding error - active database transaction detected during request shutdown: HOT 7
- Display debug messages
- Merge User Accounts error HOT 3
- 2 issue HOT 3
- PHP 8.2 HOT 2
- Problme when merging HOT 2
- sql views should be ignored HOT 4
- Assignment / note and written feedback not recovered HOT 5
- minor updates HOT 1
- Unnecessary popup on the 'Merge user accounts' page HOT 4
- duplicated value when merging grades
- Improvements when mergin online
- Deleted users appear in search results HOT 3
- Database error searching by all with PostgreSQL HOT 2
- Ownership IDs not being transferred in custom reports
- Creation of dynamic property AssignSubmissionTableMerger::$duplicateddatamerger is deprecated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moodle-tool_mergeusers.