Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin uses non existent class in Moodle below 4.2 #126

Open
durzo opened this issue Aug 2, 2024 · 1 comment
Open

plugin uses non existent class in Moodle below 4.2 #126

durzo opened this issue Aug 2, 2024 · 1 comment

Comments

@durzo
Copy link

durzo commented Aug 2, 2024

This is related to #114 but in a different place.

https://github.com/davosmith/moodle-checklist/blame/be6e5afa60317fdee26d48778e351c6bba748f45/locallib.php#L230 calls \core_external\util::format_text() but this was not added until Moodle 4.2 as part of MDL-76583

On Moodle prior to 4.2, you should use external_format_text() instead.

The plugin is listed as supporting Moodle back to 4.1 on https://moodle.org/plugins/mod_checklist/versions

Ideally the plugin should be broken up into different versions for each major Moodle by branches MOODLE_401_STABLE, MOODLE_403_STABLE etc like other plugins otherwise its bound to break when HQ make core api changes like this.

This bug prevents the mobile app from working, when clicking on a course activity the exception is shown instead.

@davosmith
Copy link
Owner

@durzo I cannot see any reason to spend time splitting the code into a separate branch in this case - the code simply needs wrapping in a call to if (class_exists(\core_external\util::class)) { and provide a fallback to external_format_text() where that is not possible.

I'm not likely to have time to look at this in detail in the immediate future - I'd be happy to review / merge a pull request to fix this, if you want to open one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants