Skip to content

Move formheading/hidehtml code to just before footer #41

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Limekiller
Copy link

@Limekiller Limekiller commented Oct 18, 2023

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

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
Copy link
Author

Hi all,

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

  • Install mod_hsuforum on a 4.1 or higher Moodle site
  • If it isn't already, use the Manage Editors page to put the new TinyMCE editor (editor_tiny) first in the list
  • Add a new Open Forum activity to a course
  • Enter the activity, click "Add a new discussion," and then "Use advanced editor and additional options"
  • Note that the editor does not load with the console message Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode.

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.

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

Successfully merging this pull request may close these issues.

1 participant