catalyst / moodle-tool_webanalytics

A Moodle admin tool adding Web Analytics to your Moodle site.
https://moodle.org/plugins/tool_webanalytics
7 stars 10 forks source link

This plugin is still mutating $CFG->additionalhtml head and should not #39

Closed brendanheywood closed 3 years ago

brendanheywood commented 3 years ago

Since ages there was new callbacks added so we can just inject html head content on the fly and never touch this setting, and the ugly cleanup of the old setting contents

brendanheywood commented 3 years ago

ie instead of mutating a setting it should return content in:

https://docs.moodle.org/dev/Output_callbacks#before_standard_html_head

or

https://docs.moodle.org/dev/Output_callbacks#before_footer

depending on which setting was chosen. Its really not clear to me why this is an admin choice, this should be just done right and in code as it affects the way other scripts load and wether they are instrumented etc. But that can be a different issue

dmitriim commented 3 years ago

I have decided to retire location as part of this issue please have a look https://github.com/catalyst/moodle-tool_webanalytics/pull/41 I wish the code has more unit tests. I may add them later. But I tested everything locally and it works as expected.