Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-65641

existing forum post with FORMAT_MOODLE are edited by HTML editors when they should not

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.16, 3.4.7, 3.5.4, 3.6, 3.7, 3.8
    • Fix Version/s: 3.6.5
    • Component/s: Forum, HTML Editor (Atto)
    • Labels:
    • Testing Instructions:
      Hide

      Pre-requisites.

      1. A user with permissions to edit forum posts (admin is ok).
      2. Ensure the user has "plain text area" in its editor preferences (user->preferences->editor preferences).
      3. Create a forum post with contents "hello <enter><enter> world!" selecting "Moodle auto-format" in the format drop-down. Save it.
      4. Verify that you see the post having 2 lines.
      5. Right-clicking, edit the post in a new window.

      A) Verify that the existing "Moodle auto-format" content is observed and immune to editor preferences.

      Summary: when MOODLE formats are being used, HTML editors cannot be used, because they don't support those formats. (this test assumes that you don't have any special moodle format alternative editor installed).

      1. In the window NOT displaying the form (just created in the last step above), go to the user editor preferences (user->preferences->editor preferences) and change it to "default editor".
      2. Reload the window displaying the form. Verify that the form doesn't show any editor and the format continues being "Moodle auto-format".
      3. Repeat the 2 steps above for "Atto HTML Editor" and "TinyMCE HTML editor". In all cases the editor won't show and the original "Moodle auto-format" format will persist.

      B) Verify that the same applies to other formats in existing content and they are honored always.

      Summary: when PLAIN/MARKDOWN formats are being used, HTML editors cannot be used, because they don't support those formats. (this test assumes that you don't have any special plain/markdown formats alternative editor installed).

      1. Repeat all the steps from previous section but with the forum post being "Plain text format".
      2. Repeat all the steps from previous section but with the forum post being "Markdown format".

      C) Verify that the editors effectively work when they support the existing format content.

      Summary: when HTML format is being used in existing content, HTML editors can be used (because they support that format).

      1. In the editor preferences, change it to "plain text area"
      2. Now edit the post and change the format to "HTML format" and save it.
      3. Verify that now contents are shown in the same line. No problem, that's expected because we have forced the HTML format.
      4. Edit the post again. No editor will be shown and format will show "HTML format".
      5. Now, in the editor preferences, select any of Atto, TintMCE or Defaul editor.
      6. Reload the edit post page. Now the editor selected will be shown (because they are able to handle the current HTML format.

      D) Verify that the editor preference affects the creation of new content.

      Summary: For new content, the editor preference is used to decide the format to use by default.

      1. With "plain text area" as editor preference.
      2. Create a new post.
      3. Verify that the form doesn't show any HTML editor and there is a format field.
      4. With Atto, TintMCE or Defaul editor. as editor preference.
      5. Create a new post.
      6. Verify that the form shows the preferred HTML editor and the format field isn't shown (it's hidden-ly HTML_FORMAT).

      E) (3.7 only!) Verify that the transition from inline-reply-post works ok

      Disclaimer: These steps assume that MDL-65635 has not been integrated. If it has landed, some behavior below may change.

      Summary: The advanced option in Moodle 3.7 (from inline-reply-post), as far as it's for new content, follows the editor preference, although, in some cases, the results are not idea (That's MDL-65635).

      1. With "plain text area" as editor preference. Introduce some contents with line jumps.
      2. Reply to an existing post (inline) and, without saving, click the "Advanced" link.
      3. Verify that the full edit post form is shown. And that both the subject and content have been copied from the inline one.
      4. Verify that no HTML editor is shown and that the format is "Moodle auto-format". Keep that window open.
      5. In another browser window change the editor preference to Atto/TinyMCE/Default.
      6. Reload the post page we left open 2 steps above.
      7. Verify that the preferred editor is shown (and yes, the contents with line jumps will be borked because we have changed to HTML mode). MDL-65635 tries to fix that.

      That's all.

      Show
      Pre-requisites. A user with permissions to edit forum posts (admin is ok). Ensure the user has "plain text area" in its editor preferences (user->preferences->editor preferences). Create a forum post with contents "hello <enter><enter> world!" selecting "Moodle auto-format" in the format drop-down. Save it. Verify that you see the post having 2 lines. Right-clicking, edit the post in a new window. A) Verify that the existing "Moodle auto-format" content is observed and immune to editor preferences. Summary: when MOODLE formats are being used, HTML editors cannot be used, because they don't support those formats. (this test assumes that you don't have any special moodle format alternative editor installed). In the window NOT displaying the form (just created in the last step above), go to the user editor preferences (user->preferences->editor preferences) and change it to "default editor". Reload the window displaying the form. Verify that the form doesn't show any editor and the format continues being "Moodle auto-format". Repeat the 2 steps above for "Atto HTML Editor" and "TinyMCE HTML editor". In all cases the editor won't show and the original "Moodle auto-format" format will persist. B) Verify that the same applies to other formats in existing content and they are honored always. Summary: when PLAIN/MARKDOWN formats are being used, HTML editors cannot be used, because they don't support those formats. (this test assumes that you don't have any special plain/markdown formats alternative editor installed). Repeat all the steps from previous section but with the forum post being "Plain text format". Repeat all the steps from previous section but with the forum post being "Markdown format". C) Verify that the editors effectively work when they support the existing format content. Summary: when HTML format is being used in existing content, HTML editors can be used (because they support that format). In the editor preferences, change it to "plain text area" Now edit the post and change the format to "HTML format" and save it. Verify that now contents are shown in the same line. No problem, that's expected because we have forced the HTML format. Edit the post again. No editor will be shown and format will show "HTML format". Now, in the editor preferences, select any of Atto, TintMCE or Defaul editor. Reload the edit post page. Now the editor selected will be shown (because they are able to handle the current HTML format. D) Verify that the editor preference affects the creation of new content. Summary: For new content, the editor preference is used to decide the format to use by default. With "plain text area" as editor preference. Create a new post. Verify that the form doesn't show any HTML editor and there is a format field. With Atto, TintMCE or Defaul editor. as editor preference. Create a new post. Verify that the form shows the preferred HTML editor and the format field isn't shown (it's hidden-ly HTML_FORMAT). E) (3.7 only!) Verify that the transition from inline-reply-post works ok Disclaimer: These steps assume that MDL-65635 has not been integrated. If it has landed, some behavior below may change. Summary: The advanced option in Moodle 3.7 (from inline-reply-post), as far as it's for new content, follows the editor preference, although, in some cases, the results are not idea (That's MDL-65635 ). With "plain text area" as editor preference. Introduce some contents with line jumps. Reply to an existing post (inline) and, without saving, click the "Advanced" link. Verify that the full edit post form is shown. And that both the subject and content have been copied from the inline one. Verify that no HTML editor is shown and that the format is "Moodle auto-format". Keep that window open. In another browser window change the editor preference to Atto/TinyMCE/Default. Reload the post page we left open 2 steps above. Verify that the preferred editor is shown (and yes, the contents with line jumps will be borked because we have changed to HTML mode). MDL-65635 tries to fix that. That's all.
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Pull from Repository:
    • Pull 3.6 Branch:
    • Pull Master Branch:

      Description

      Working on MDL-65635 (and in fact being one of the main reasons for it), was detected that, when a existing content (for example a forum post) is using FORMAT_MOODLE, if the user has any HTML editor as preference... then, editing the content displays the editor, obviously borking the original formal (newlines basically).

      Other formats (FORMAT_PLAIN and FORMAT_MARKDOWN) don't lead to that problem at all. With them the existing content format has precedence over the editor preference. That's the correct approach.

      So this is about to make FORMAT_MOODLE to behave exactly the same. Existing format should have precedence over any editor preference.

      It's the only way to honor the original content and format.

      This has been detected in forum posts with Atto but maybe applies to any other content and editors... worth trying in places like glossary entries, page resources, course descriptions... and with both atto and mce editors and fix it where needed.

      tldr;, the format of exiting content must win always!

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                stronk7 Eloy Lafuente (stronk7)
                Reporter:
                stronk7 Eloy Lafuente (stronk7)
                Peer reviewer:
                Carlos Escobedo
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Carlos Escobedo
                Participants:
                Component watchers:
                Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Jul/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 5 minutes
                  4h 5m