davidherney / moodle-format_onetopic

Course format Onetopic to LMS Moodle
GNU General Public License v3.0
19 stars 45 forks source link

After upgrade to Moodle 4.4, Onetopic throws error trying to require a non-existent format.js from topics plugin. #181

Closed lightweight closed 6 months ago

lightweight commented 6 months ago

After upgrading from Moodle 4.1 to 4.4 recently, I encountered the following error in the onetopic plugin version 4.1.04...

Coding error detected, it must be fixed by a programmer: Attempt to require a JavaScript file that does not exist.

[More information about this error](http://docs.moodle.org/404/en/error/debug/codingerror)
Debug info: /course/format/topics/format.js
Error code: codingerror
Stack trace:

    line 737 of /lib/outputrequirementslib.php: coding_exception thrown
    line 452 of /lib/outputrequirementslib.php: call to page_requirements_manager->js_fix_url()
    line 84 of /course/format/onetopic/format.php: call to page_requirements_manager->js()
    line 348 of /course/view.php: call to require()

It turns out /course/format/onetopic/format.php line 84, references a no-longer-existent (in Moodle 4.4 at least) javascript file:

$PAGE->requires->js('/course/format/topics/format.js');

Commenting that line out removes the error, and I haven't noticed any other side effects.

I see this inclusion was removed with commit 72eacc50412779bfe49088d357b129131842a5dc but I'm not sure how to upgrade to that version (not familiar enough with Moodle), so (currently) assuming it's being held back due to other dependencies...

lightweight commented 6 months ago

Further info - I've tried installing the 4.2.02 version of the format_onetopic plugin (there doesn't seem to be a corresponding release here in Github?)... and the same inclusion error occurs, but it's been moved to /course/format/onetopic/classes/header.php - again, commenting out line 151 seems to fix the problem.

I gather this plugin has been tested with Moodle 4.2... but it seems that it's not compatible with Moodle 4.4 - not sure about 4.3.

izendegi commented 6 months ago

Hi @lightweight

We've seen this same issue and realized that #178 fixes it

lightweight commented 6 months ago

Wow, many thanks!

davidherney commented 6 months ago

Hi...

The master is now compatible with Moodle 4.4+ in beta. It needs proof. If you can try it please comment.

Saludos