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

Default Completion Editor form failure with System_archetype plugins.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Deferred
    • Icon: Minor Minor
    • None
    • 4.4.1
    • Course completion
    • None
    • MOODLE_404_STABLE

      The course completion default edit page fails when a plugin does not implement or fails to implement with the suffix options ([Moodle 4.3 developer update | Moodle Developer Resources|https://moodledev.io/docs/4.3/devupdate#activity-completion]) which is fine.

      However if a mod_* plugin defines itself via `_supports` that is `MOD_ARCHETYPE_SYSTEM` (which is defined in the code as "System (not user-addable) module archetype), then the whole code for loading the `mod_form.php` is executed, in order to generate the completion criteria element on this page, which (IMHO) is uncessary.

      Alternatively in `core_completion_defaultedit_form::get_module_form()` why the election to throw an exception if the form doesn't exist? After all if the form doesn't meet the requirements for a suffix being implemented it gets dropped, rather than a breaking exception being thrown.

      (noting that that whilst mod_form.php is required, for system archetypes it could be uncesssary, if there is no user-facing creation).

      In addition the loading of the whole mod_form.php to simply extract the completion criteria form structure also results in execution of code in `definition()` that may be do support the activity's creation (e.g. fetching data in PHP, rather than AJAX) that is distinct for the generation of the completion criteria form.

      Given the rest of the form is being discarded for the completion criteria conditions, why does the whole form need to be instantiated, and not a call just to "add_completion_rules()" 

            Unassigned Unassigned
            mhughes2k Michael Hughes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.