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

Can't subscribe other user to forum

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.1.7, 2.2.4
    • Component/s: Forum
    • Labels:

      Description

      If you attempt to subscribe another user to a forum you produce the following stack trace:
      Debug info: Column 'userid' cannot be null
      INSERT INTO mdl_forum_subscriptions (userid,forum) VALUES(?,?)
      [array (
      0 => NULL,
      1 => '2',
      )]
      Error code: dmlwriteexception
      Stack trace:
      line 416 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 952 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 994 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      line 4560 of /mod/forum/lib.php: call to mysqli_native_moodle_database->insert_record()
      line 170 of /mod/forum/subscribe.php: call to forum_subscribe()
      Output buffer: <br /> <b>Notice</b>: Undefined property: stdClass::$id in <b>/html/mod/forum/subscribe.php</b> on line <b>134</b><br /> <br /> <b>Notice</b>: Undefined property: stdClass::$id in <b>/html/mod/forum/subscribe.php</b> on line <b>170</b><br />

      The $DB->get_record() call on line 65 includes only three parameters, so it never returns any fields. I'm not sure how to actually reach this code via the interface; I noticed the function call and worked backwards to produce the stack trace.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    9/Jul/12