-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
2.0, 2.1.1, 2.2
-
MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
When working on MDL-26841, I detected one inconsistency/missing feature in the enrollment api: It seems that the detection/permission to create multiple instances is somehow incomplete. So for example:
- In one course already having one "guest" plugin, the get_newinstance_link() method properly detects it and avoids to return one link to create a new instance.
- But in the same course, the add_instance() method does not detect it and creates one new instance without problems.
So, I think we should implement/extend the API to:
1) Define, for each enrol plugin, if multiple instances are allowed for a given context. And provide public getter for that.
2) Define another method, ideally public too, to perform all the checks necessary to detect if one new instance can be added (returns true/false).
3) Optional: make add_instance() to use 1 & 2 above and return null if the instance was not created (there are code relying on this right now).
That is, for your consideration. Surely we should offer BC defaults to current behavior and perhaps it's one new feature/bugfix so I'd consider backporting it to 21_STABLE.
Ciao
- duplicates
-
MDL-35071 Redesign enrol restore support
-
- Closed
-
- has a non-specific relationship to
-
MDL-31497 Restoring a backup can lead to multiple guest enrolment instances
-
- Closed
-
- will help resolve
-
MDL-27061 Restoring backup with option "Merge the backup course into this course" causes duplicate section "Guest access" in "Edit course settings" form.
-
- Closed
-