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

Course request related notifications are incorrectly (pre)formatted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.1.12, 4.3.6, 4.4.1, 4.5, 4.5.2, 5.0
    • Course
    • MOODLE_401_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE, MOODLE_405_STABLE, MOODLE_500_STABLE

      Notifications related ro course requests (course requests, course request approvals, also course request rejections) are incorrectly handled as plain-text, badly affecting users' experience, especially via the WWW GU interface:

      • Notifications are displayed surrounded with the "pre" tag that fails to wrap lines around, and use fixed-width fonts
      • hyperlinks do not work even if languages strings such as the core "courserequestnotifyemail" string contain them as formatted a tags

      I think the problem is that the protected function "notify" in the /course.lib.php file does not save any output into the "fullmessagehtml" column of the related DB table mdl_notifications.

      Not sure this is all that's required to fix everything correctly, but on my sites - as a workaround fix - I have replaced the line:

      $eventdata->fullmessagehtml   = '';

      with

      $eventdata->fullmessagehtml   = $message;

      and am now receiving properly formatted HTML course request notifications - fonts, wrapping, and hyperlinking working correctly in them.

      (In the said DB table mdl_notifications I now have exactly the same text entries in the "fullmessage" and "fullmessagehtml" columns. I am also not sure if the "$eventdata->fullmessageformat = FORMAT_PLAIN;" declaration in the notify function is the best or correct.)

      While working on my workaround, I also spotted that the language string core_admin > courseapprovedemail2 string sent in course request approval notices applied merely {$a->url} for the created new course hyperlink, while the effective solution should (IMO) be <a href="{$a->url}">{$a->url}</a> . I have already filed a fix proposal for en_fix on the AMOS platform. (The course request string (core > courserequestnotifyemail) is already properly formatted for HTML notifications, using the "a" tag.)

      Before my fix:

      After my fix:

            Unassigned Unassigned
            pmk Przemek Kaszubski
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

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