moodle-editor_marklar icon indicating copy to clipboard operation
moodle-editor_marklar copied to clipboard

Undefined fpoptions prevents Marklar from loading

Open juancs opened this issue 5 years ago • 3 comments

I've been facing a problem where, sometimes, Marklar doesn't loads in the page.

The init function int the amd module uses M.editor_marklar. js_init_code is put in the page after the init call leading to a race condition: sometimes M.editor_marklar is defined, sometimes it isn't.

With this patch, M.editor_marklar is initialized just before the init function gets called.

juancs avatar Dec 26 '19 08:12 juancs

Well spotted @juancs - and thanks for the patch! I'll try to reproduce this and debug a bit more. Maybe this is a good opportunity to actually modernise the whole JS loading to match the latest moodledev guidelines.

mudrd8mz avatar Jun 09 '21 13:06 mudrd8mz

Is this still happening?

mudrd8mz avatar Mar 02 '25 12:03 mudrd8mz

Hi David,

I've been using the patch in production for six year now. Back then it seemed to me clear that this was a race condition: the module init code executing before fpoptions gets initalized. And I think the problem still exists.

I've no complains since then :)

juancs avatar Mar 07 '25 22:03 juancs