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

messagelib is using is_int() on userids, which causes message send to fail sometimes. Needs to be is_numeric().

XMLWordPrintable

    • MOODLE_23_STABLE
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • MDL-34535-master
    • Hide
      1. Dump the attached test.php in root of your moodle install
      2. Edit test.php and change the $eventdata->userto to a valid user id
      3. Run test.php from browser
      4. make sure you get "Success" echoed
      5. login as the userto user and make sure you get the msg
      Show
      Dump the attached test.php in root of your moodle install Edit test.php and change the $eventdata->userto to a valid user id Run test.php from browser make sure you get "Success" echoed login as the userto user and make sure you get the msg

      Writing a module that send a message like this fails because line 63 of messagelib.php doesn't recognise the userid which comes in as a string.

      $eventdata = new stdClass();
      $eventdata->component = 'mod_coursework';
      $eventdata->name = 'deadlinechanged';
      $eventdata->userfrom = $USER;
      // $dbrecord is from a standard $DB->get_record() call
      $eventdata->userto = $dbrecord->studentid;
      // etc
       
      message_send($eventdata);

            ankit_frenz Ankit Agarwal
            mattgibson Matt Gibson
            Rossiani Wijaya Rossiani Wijaya
            Dan Poltawski Dan Poltawski
            Frédéric Massart Frédéric Massart
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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