Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-48362

Improve the enrol API to prevent logic in the UI

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.3, 2.8.1
    • Fix Version/s: 3.1
    • Component/s: Enrolments
    • Sprint:
      Team '; drop tables Sprint 9, Team ';drop tables Sprint 10, 3.1 Sprint 5
    • Issue size:
      Large

      Description

      Currently the enrolment API relies on logic that is tied to the user interface. Two examples:

      • the callback enrol_plugin::get_newinstance_link() determines whether or not a new instance can be added to the course.
      • the enrol plugin meta has advanced validation happening in its form class

      If we want to be able to add webservices to the enrolments, or make the plugins self-aware of their limitations, settings, validations, ... the API should be self-contained and not spread across UI methods, or form validations.

      Moreover, there is not defined mapping between the columns customint, customchar, ... making it really difficult to create generic webservices or external use of the enrolment API. An existing example is the ability to create new enrolments in tool_uploadcourse where a user has to analyse the code to find out how what customxxx columns to use to configure the enrolments methods.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  23/May/16