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

HTML-messages are not displayed correctly on Message History page

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: STABLE backlog
    • Component/s: Messages
    • Labels:
    • Testing Instructions:
      Hide

      1. Run this PHP-file in browser (you can change user ids before):

      <?php
       
      require_once "config.php";
       
      $idfrom = 4;
      $idto = 5;
      $userfrom = $DB->get_record('user', array('id' => $idfrom));
      $userto = $DB->get_record('user', array('id' => $idto));
       
      $text = '1<a href="http://www.moodle.org/">2</a>3';
      message_post_message($userfrom, $userto, $text, FORMAT_HTML, 'direct');
       
      ?>

      2. Login as User#5
      3. Go to Messages
      4. In recent conversations you will see HTML link
      5. Go to convercation with User#4
      6. You will not see HTML link here (only text)

      Show
      1. Run this PHP-file in browser (you can change user ids before): <?php   require_once "config.php";   $idfrom = 4; $idto = 5; $userfrom = $DB->get_record('user', array('id' => $idfrom)); $userto = $DB->get_record('user', array('id' => $idto));   $text = '1<a href="http://www.moodle.org/">2</a>3'; message_post_message($userfrom, $userto, $text, FORMAT_HTML, 'direct');   ?> 2. Login as User#5 3. Go to Messages 4. In recent conversations you will see HTML link 5. Go to convercation with User#4 6. You will not see HTML link here (only text)
    • Affected Branches:
      MOODLE_22_STABLE

      Description

      We have a code which sends messages to users and notifies them about different events. For example, we send a message to Teacher if Student has submitted a certification request. Each message is formed in HTML format (FORMAT_HTML) and all our messages contain links (<a href="...">text</a>). Within the "Recent Convercations" section we can see the messages history as expected (HTML format). But within the single user messages history all messages become a plain text.

      For example, instead of the following HTML:

      Your Certification request <b>"PT Certification"<b> for <a href="http://moodle.local/course/view.php?id=2">Writing Frames</a> Learning Path has been approved. Please, read message: ...

      user can see the following:

      Your Certification request "PT CERTIFICATION" for Writing Frames [1] Learning Path has been approved. Please, read message: ... Links: ------ [1] http://moodle.local/course/view.php?id=2

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: