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

mark_notification_read fails if messaging disabled

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.7.4, 3.8.1, 3.9
    • 3.7.5, 3.8.2
    • Messages
    • MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_37_STABLE, MOODLE_38_STABLE
    • MDL-67471_master
    • Hide
      1. As admin disable messaging via Site administration -> Messaging -> Messaging settings -> Enable messaging system: No
      2. Create a popover notification.
        1. As admin create a course with a teacher and a student in it.
        2. As teacher create an assignment in that course.
        3. As student submit a file to that assignment.
          => As the student you should now see a 1 next to the bell icon at the top.
      3. As student click on the bell icon.
      4. Click on the link "View full notification" next to the unread notification.

      This shouldn't give an error but without the fix you get the error shown in the screenshot.

      Show
      As admin disable messaging via Site administration -> Messaging -> Messaging settings -> Enable messaging system: No Create a popover notification. As admin create a course with a teacher and a student in it. As teacher create an assignment in that course. As student submit a file to that assignment. => As the student you should now see a 1 next to the bell icon at the top. As student click on the bell icon. Click on the link "View full notification" next to the unread notification. This shouldn't give an error but without the fix you get the error shown in the screenshot.

    Description

      When messaging is disabled for the site and you have unread popover notifications click on the "View full notification" link of one of those unread notifications. The page will load, but then the AJAX request to mark that notification as read fails and you get an error dialog box.

      This makes no sense as notifications and messages are separate with each having its own DB table. The function "mark_notification_read" only sets the column "timeread" in the notifications table. However, it contains this check:

      https://github.com/moodle/moodle/blob/fcc93935bea314457591b5b0e4ee7a227fbfea95/message/externallib.php#L3616-L3619

      That check should just be removed as messaging doesn't use the notification table (anymore).

      Attachments

        Issue Links

          Activity

            People

              tschroeder Tim Schroeder
              tschroeder Tim Schroeder
              Neill Magill Neill Magill
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Janelle Barcega Janelle Barcega
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Mar/20

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 15 minutes
                  1h 15m