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

Some notifications sent using message_send are considered personal private messages

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.2
    • Fix Version/s: 2.7
    • Component/s: Messages
    • Labels:
    • Testing Instructions:
      Hide
      • As a teacher create a new Feedback activity (including one question is enough), when creating the activity check the option for receive notifications when the user submit a feedback
      • Go to the teacher messaging option, enable at least one notification plugin for the feedback messages
      • As a student submit the feedback
      • As a teacher go to your Messages, check that you have received a new message, read the message. Once read, select "Recent notifications" under "Message navigation"
      • You should see there the notification (feedback submitted)
      • As a teacher send a private message to a student
      • Login as the student go to your personal messages, check that you have received a new message, read the message. Once read, select "Recent messages" you should see there the message
      Show
      As a teacher create a new Feedback activity (including one question is enough), when creating the activity check the option for receive notifications when the user submit a feedback Go to the teacher messaging option, enable at least one notification plugin for the feedback messages As a student submit the feedback As a teacher go to your Messages, check that you have received a new message, read the message. Once read, select "Recent notifications" under "Message navigation" You should see there the notification (feedback submitted) As a teacher send a private message to a student Login as the student go to your personal messages, check that you have received a new message, read the message. Once read, select "Recent messages" you should see there the message
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      According http://docs.moodle.org/dev/Message_API :

      $eventdata->notification      = 1; //this is only set to 0 for personal messages between users
      

      Also

       *  notification bool should the message be considered as a notification rather than a personal message
       *  contexturl string if this is a notification then you can specify a url to view the event. For example the forum post the user is being notified of.
       *  contexturlname string the display text for contexturl
       *
       * @category message
       * @param object $eventdata information about the message (component, userfrom, userto, ...)
       * @return mixed the integer ID of the new message or false if there was a problem with a processor
       */
      function message_send($eventdata) {
      

      But I've found that lots of notifications sent using the current API are not marked as notifications (so they are considered personal messages):

      /admin/handlevirus.php -> line 78
      /backup/util/helper/backup_cron_helper.class.php -> line 283
      /lib/uploadlib.php -> line 712
      /enrol/paypal/ipn.php -> line 150
      /enrol/paypal/ipn.php -> line 254
      /enrol/paypal/ipn.php -> line 273
      /enrol/paypal/ipn.php -> line 292
      /enrol/paypal/ipn.php -> line 330
      /lib/enrollib.php -> line 2186
      /lib/enrollib.php -> line 2255

      and more...

      In all the cases, this line is missing $eventdata->notification = 1;

      I also don't understand why the event should be marked as a notification, when all the event used to be notifications (the only exception are user private messages).
      Should we change the message_send code to make $eventdata->notification default to 1 if is missing?
      Or should be add all the missing $eventdata->notification = 1;?

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/May/14