Moodle
  1. Moodle
  2. MDL-30273

Students and teachers can add additional topics to a simple forum discussion

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 1.9.15, 2.0.7, 2.1.4
    • Component/s: Forum
    • Labels:
    • Environment:
      qa.moodle.net
    • Database:
      Any
    • Testing Instructions:
      Hide

      1. Login as a teacher and start a discussion in a single simple discussion forum.
      2. Login as a student and enter the manual URL.
      3. Check that, as a student, it is not possible to start a discussion.

      Show
      1. Login as a teacher and start a discussion in a single simple discussion forum. 2. Login as a student and enter the manual URL. 3. Check that, as a student, it is not possible to start a discussion.
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-30273-master

      Description

      This was revealed by MDLQA-1196. It's possible for teachers and students to add new topics to a simple forum discussion by manually going to the appropriate URL (your.moodle.instance/mod/forum/post.php?forum=FORUMID). The forum page itself will still only show the first forum posting since it uses get_record() to pull the discussions, but if you have debugging turned on you'll get a db error since multiple records were found:

      Error: mdb->get_record() found more than one record!
      line 1302 of /lib/dml/moodle_database.php: call to debugging()
      line 1262 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
      line 1242 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      line 144 of /mod/forum/view.php: call to moodle_database->get_record()

      The forum shouldn't rely on the interface alone to control this behavior.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Michael de Raadt added a comment -

            Thanks for being involved in testing and reporting that issue.

            Show
            Michael de Raadt added a comment - Thanks for being involved in testing and reporting that issue.
            Hide
            Charles Fulton added a comment -

            There's a related issue which cropped up in MDLQA-1191: it's possible to move a discussion into a single-discussion forum. Once you've done this the discussion effectively disappears.

            Show
            Charles Fulton added a comment - There's a related issue which cropped up in MDLQA-1191 : it's possible to move a discussion into a single-discussion forum. Once you've done this the discussion effectively disappears.
            Hide
            Charles Fulton added a comment -

            Patch for 2.2: https://github.com/mackensen/moodle/compare/master...MDL-30273. I've checked and this doesn't interfere with creating a new single topic forum, and since you can't delete the original topic there's no reason to ever create a new topic in such a forum.

            Show
            Charles Fulton added a comment - Patch for 2.2: https://github.com/mackensen/moodle/compare/master...MDL-30273 . I've checked and this doesn't interfere with creating a new single topic forum, and since you can't delete the original topic there's no reason to ever create a new topic in such a forum.
            Hide
            Aparup Banerjee added a comment -

            note: just corrected the url in description - use your.moodle.instance/mod/forum/post.php?forum=FORUMID

            Show
            Aparup Banerjee added a comment - note: just corrected the url in description - use your.moodle.instance/mod/forum/post.php?forum=FORUMID
            Hide
            Ankit Agarwal added a comment -

            Hi guys,
            Patch is looking good and works perfectly.
            However I discovered another related issue.
            Say we have a "standard forum" with 3 discussion.
            If you login as admin and try to convert the forum to a "single discussion forum" it will let you do so, however it will still generate the debug errors as above since now get_records are returning multiple records.

            Adrian
            Can you please create a followup issue for that?
            Thanks

            Show
            Ankit Agarwal added a comment - Hi guys, Patch is looking good and works perfectly. However I discovered another related issue. Say we have a "standard forum" with 3 discussion. If you login as admin and try to convert the forum to a "single discussion forum" it will let you do so, however it will still generate the debug errors as above since now get_records are returning multiple records. Adrian Can you please create a followup issue for that? Thanks
            Hide
            Martin Dougiamas added a comment -

            Note I've already closed the MDLQA test because the test actually passed.

            But this bug (and related ones) should still be fixed, obviously.

            Show
            Martin Dougiamas added a comment - Note I've already closed the MDLQA test because the test actually passed. But this bug (and related ones) should still be fixed, obviously.
            Hide
            Sam Hemelryk added a comment -

            Thanks Adrian, this has been integrated now

            Show
            Sam Hemelryk added a comment - Thanks Adrian, this has been integrated now
            Hide
            Sam Hemelryk added a comment -

            Tested and passed

            Show
            Sam Hemelryk added a comment - Tested and passed
            Hide
            Eloy Lafuente (stronk7) added a comment -

            The master fixes corresponding to this issue have been sent upstream. Fixes for other branches (19, 20, 21 stable) will be sent in the very-next days.

            Thanks for the hard work! Closing, ciao

            Show
            Eloy Lafuente (stronk7) added a comment - The master fixes corresponding to this issue have been sent upstream. Fixes for other branches (19, 20, 21 stable) will be sent in the very-next days. Thanks for the hard work! Closing, ciao

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: