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

Comment format ignored on the instant display

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.7, 2.8.5
    • Fix Version/s: 2.7.8, 2.8.6
    • Component/s: Comments
    • Labels:
    • Testing Instructions:
      Hide

      Testing difficulty: easy, yet requires access to the source code

      1. Prepare a simple Assignment instance (online text submissions, comments feedback allowed)
      2. As a student, submit some dummy text
      3. Now edit the file mod/assign/submission/comments/lib.php and locate the function assignsubmission_comments_comment_add(). At the very end of this function, add the following code:

        $comment->format = FORMAT_PLAIN;
        

      4. Go and add a comment like '<h1>Muhehe</h1>' to the submission
      5. TEST: Make sure that the comment is displayed and formatted as plain text right after you click the Save comment.
      Show
      Testing difficulty: easy, yet requires access to the source code Prepare a simple Assignment instance (online text submissions, comments feedback allowed) As a student, submit some dummy text Now edit the file mod/assign/submission/comments/lib.php and locate the function assignsubmission_comments_comment_add(). At the very end of this function, add the following code: $comment->format = FORMAT_PLAIN; Go and add a comment like '<h1>Muhehe</h1>' to the submission TEST: Make sure that the comment is displayed and formatted as plain text right after you click the Save comment.
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-49674-master-commentformat

      Description

      When adding a new comment via the comment API, the comment area owner plugin has a chance to modify the comment via a callback. If the plugin modifies the comment format from the default FORMAT_MOODLE to something else, the comment is still rendered with the default format when returned to the client as the AJAX response. When the user reloads the whole page again, only then the comment is properly formatted using the stored format value.

      Expected behaviour

      When adding a comment via AJAX, the instant display should respect the eventually modified format already.

      What actually happens

      The format is respected only at the next full page loads.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/May/15