moodle-editor_marklar
                                
                                 moodle-editor_marklar copied to clipboard
                                
                                    moodle-editor_marklar copied to clipboard
                            
                            
                            
                        Undefined fpoptions prevents Marklar from loading
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.
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.
Is this still happening?
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 :)