open-lms-open-source / moodle-mod_hsuforum

13 stars 45 forks source link

Move formheading/hidehtml code to just before footer #41

Open Limekiller opened 1 year ago

Limekiller commented 1 year ago

This fixes an issue where editor_tiny doesn't load on the post.php page because there is output (in this case, a style tag) above the \<!DOCTYPE html> tag, which forces the page into quirks mode. TinyMCE doesn't load in quirks mode: https://stackoverflow.com/questions/68689918/tinymce-editor-is-not-loading-because-document-is-not-in-standards-mode-how-ca

Limekiller commented 1 year ago

Hi all,

Currently the advanced editor won't load on the post.php page of mod_hsuforum when using editor_tiny. To reproduce,

This issue is occurring because the post.php page prints output above the DOCTYPE tag. This is bad practice, and forces the page into quirks mode, which causes TinyMCE not to load. It didn't look like the code block that includes this styling is needed until the formheading conditional at the bottom of the file, so I moved it just above said conditional, allowing the editor to load.