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

mark_notification_read fails if messaging disabled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.7.4, 3.8.1, 3.9
    • Fix Version/s: 3.7.5, 3.8.2
    • Component/s: Messages
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE
    • Pull 3.7 Branch:
    • Pull 3.8 Branch:
    • Pull Master Branch:
      MDL-67471_master

      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

              Assignee:
              tschroeder Tim Schroeder
              Reporter:
              tschroeder Tim Schroeder
              Peer reviewer:
              Neill Magill
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                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