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

Single discussion forums can not be added

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 2.4
    • 2.4
    • Forum
    • MOODLE_24_STABLE
    • MOODLE_24_STABLE
    • MDL-34711_master
    • Hide
      1. As an admin or teacher go to a course
      2. As an admin or teacher create a forum instance with "Forum type" set as "A single simple discussion"
      3. You SHOULD be able to create the forum instance without any exceptions thrown
      Show
      As an admin or teacher go to a course As an admin or teacher create a forum instance with "Forum type" set as "A single simple discussion" You SHOULD be able to create the forum instance without any exceptions thrown

      When trying to add a forum instance with "single discussion" as forum type moodle throws a "Can not find data record in database table course_modules" exception. It seems a regression caused by MDL-32229

      The course module is not set until MODULENAME_add_instance() finishes. forum_trigger_content_uploaded_event() should only be called if there is a course module id

      Debug info: SELECT id,course FROM {course_modules} WHERE id IS NULL
      [array (
      )]
      Error code: invalidrecord
      Stack trace:
      line 1321 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
      line 1297 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      line 6783 of /lib/accesslib.php: call to moodle_database->get_record()
      line 4572 of /mod/forum/lib.php: call to context_module::instance()
      line 4440 of /mod/forum/lib.php: call to forum_trigger_content_uploaded_event()
      line 96 of /mod/forum/lib.php: call to forum_add_discussion()
      line 447 of /course/modedit.php: call to forum_add_instance()
      Output buffer: Notice: Trying to get property of non-object in /home/davidm/Desktop/moodlecode/master/mod/forum/lib.php on line 4572 Call Stack: 0.0011 1025336 1. {main}() /home/davidm/Desktop/moodlecode/master/course/modedit.php:0 0.3279 54118680 2. forum_add_instance() /home/davidm/Desktop/moodlecode/master/course/modedit.php:447 0.5536 54207760 3. forum_add_discussion() /home/davidm/Desktop/moodlecode/master/mod/forum/lib.php:96 0.7051 54313000 4. forum_trigger_content_uploaded_event() /home/davidm/Desktop/moodlecode/master/mod/forum/lib.php:4440

            dmonllao David Monllaó
            dmonllao David Monllaó
            Dan Poltawski Dan Poltawski
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Adrian Greeve Adrian Greeve
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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