FMCorz / moodle-block_xp

A gamification plugin for Moodle allowing students to gain experience points and level up.
https://levelup.plus/?ref=github
150 stars 42 forks source link

Use of removed Form Change Checker YUI module in Moodle 4.4 #169

Closed marcestone closed 2 months ago

marcestone commented 2 months ago

In /renderer.php there is a call to moodle-core-formchangechecker. That YUI module was deleted in MDL-72308. This can be fixed replacing that call as the following code:

--- $this->page->requires->yui_module('moodle-core-formchangechecker', 'M.core_formchangechecker.init',[['formid' => $formid]]);

+++ $this->page->requires->js_call_amd('core_form/changechecker', 'watchFormById', [$formid]);

FMCorz commented 2 months ago

Hi @marcestone,

The call is conditional on the Moodle version and should not be used since Moodle 4.0.

        if ($CFG->branch >= 400) {
            $this->page->requires->js_call_amd('core_form/changechecker', 'watchFormById', [$formid]);
        } else {
            ...
            $this->page->requires->yui_module('moodle-core-formchangechecker', 'M.core_formchangechecker.init',
                [['formid' => $formid]]);
        }

I am closing this issue as it does not appear to be a bug, would you please provide replication steps if it is.

Thank you!