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

Ensure clicked notifications are marked read - Regression: A required parameter (notificationid) was missing

XMLWordPrintable

    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MDL-62658_master
    • Hide
      1. Log in as the admin.
      2. Create a course.
      3. Create a forum.
      4. Add a new discussion topic.
      5. Enrol a student into the course.
      6. Log in as the student in another browser.
      7. Click on the 'Notification' icon and then 'Notification preferences'.
      8. Toggle it to 'On' for 'Web' notifications for 'Subscribed forum posts'.
      9. Visit the course.
      10. Reply to the forum post.
      11. As the admin reply to the student's forum post and check 'Send forum post notifications with no editing-time delay'.
      12. Run the cron.
      13. As the student notice you have a notification.
      14. Click on the notification.
      15. Confirm it gets marked as read and you are directed to the forum.
      Show
      Log in as the admin. Create a course. Create a forum. Add a new discussion topic. Enrol a student into the course. Log in as the student in another browser. Click on the 'Notification' icon and then 'Notification preferences'. Toggle it to 'On' for 'Web' notifications for 'Subscribed forum posts'. Visit the course. Reply to the forum post. As the admin reply to the student's forum post and check 'Send forum post notifications with no editing-time delay'. Run the cron. As the student notice you have a notification. Click on the notification. Confirm it gets marked as read and you are directed to the forum.

      MDL-56498 message: Ensure clicked notifications are marked read

      I get the error 'A required parameter (notification id) was missing' when I click in the link inside popup notifications. This behavior, I believe, is because the below code has an issue.
      See:

      // Link to mark read page before loading the actual link.
      {{ notification.contexturl = URL.relativeUrl('message/output/popup/mark_notification_read.php', {}}
      {{ redirecturl: notification.contexturl,}}
      notificationid: notification.id,
      {{ });}}

       

      This will build an incorrect url path, like this: 

      http://<wwwroot>moodle/message/output/popup/mark_notification_read.php?redirecturl=http://<wwwroot>/moodle/mod/forum/discuss.php?d=684#p2916&notificationid=56608

       

      A solution is change parameters order:

      notificationid: notification.id, redirecturl: notification.contexturl,

            markn Mark Nelson
            fernandoroch4 Fernando Rocha
            Carlos Escobedo Carlos Escobedo
            Jun Pataleta Jun Pataleta
            Gladys Basiana Gladys Basiana
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 40 minutes
                40m

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