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

Noreply user cannot be used in message_send()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.6
    • 2.6
    • Libraries, Messages
    • MOODLE_26_STABLE
    • MOODLE_26_STABLE
    • wip-mdl-42754
    • Hide

      NOTE: Testing expects MDL-39923 to be integrated.

      1. Go to /admin/settings.php?section=messagesettingemail admin settings and make sure that "Allow attachments" is set to NO.
      2. In user profile messaging, set badge notifications to pop-up and email for online and offline
      3. Under badge -> Messgae set "Notify badge creator" to "Every time"
      4. Award badge to user as teacher and go to messages
      5. Check you should be able to see unread message fro noreply user
      6. Click on noreply user and you should see the notification
      7. make sure you don't see send message option and neither can click on nouser image.

      Test 2:

      1. Enable quiz specific messaging to be sent as popup and email for online and offline.
      2. Create a quiz with few question
      3. Give "mod/quiz:emailconfirmsubmission" to student.
      4. Attempt quiz and make sure student gets a notification about submission and mail is from noreply user.
      5. Change $CFG->noreplyuserid to some userid and make sure noreply msg is from that user
      Show
      NOTE: Testing expects MDL-39923 to be integrated. Go to /admin/settings.php?section=messagesettingemail admin settings and make sure that "Allow attachments" is set to NO. In user profile messaging, set badge notifications to pop-up and email for online and offline Under badge -> Messgae set "Notify badge creator" to "Every time" Award badge to user as teacher and go to messages Check you should be able to see unread message fro noreply user Click on noreply user and you should see the notification make sure you don't see send message option and neither can click on nouser image. Test 2: Enable quiz specific messaging to be sent as popup and email for online and offline. Create a quiz with few question Give "mod/quiz:emailconfirmsubmission" to student. Attempt quiz and make sure student gets a notification about submission and mail is from noreply user. Change $CFG->noreplyuserid to some userid and make sure noreply msg is from that user

      There are several issues here:

      1. Noreply user is being generated by core_user::get_noreply_user(). When used in message_send(), it throws a warning Notice: Undefined property: stdClass::$maildisplay in /lib/moodlelib.php on line 5727.

      2. If I try to manually add maildisplay setting to the user object created by get_noreply_user(), everything seems to work fine, all messages are sent. However, when a user who got a message from noreply or support users goes to the messages page in their profile, they can see that there are unread messages, but there is no way of actually accessing the message.

      To reproduce the warning:

      Create a course with a quiz. Enrol a user. Enable "quiz:emailconfirmsubmission" capability for student role (so that students can get confirmations that they submitted a quiz) and attempt the quiz. You will get "Undefined property: stdClass::$maildisplay" warning.

            rajeshtaneja Rajesh Taneja
            ybozhko Yuliya Bozhko
            Petr Skoda Petr Skoda
            Damyon Wiese Damyon Wiese
            Frédéric Massart Frédéric Massart
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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