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

Comment format ignored on the instant display

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.7.8, 2.8.6
    • 2.7.7, 2.8.5
    • Comments
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MDL-49674-master-commentformat
    • 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.

      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.

            mudrd8mz David Mudrák (@mudrd8mz)
            mudrd8mz David Mudrák (@mudrd8mz)
            Sam Marshall Sam Marshall
            Dan Poltawski Dan Poltawski
            Dave Cooper Dave Cooper
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.