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

Inifinite loop if question category points to itself as a parent

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.5, 2.3, 2.4
    • 2.2.6, 2.3.3
    • Questions
    • MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • Hide

      1. Create several question categories and sub-categories in a course (the more the better).
      2. Confirm all categories are displayed OK in a drop-down on question/edit.php?courseid=N page.
      3. Edit database by hand to create a loop: in table mdl_question_categories find a top-level (with parent=0) category from your course and change parent to the id of one of the children.
      4. Confirm that an exception is thrown, instead of infinite loop and timeout (previous behaviour)
      5 Repeat 3 & 4 but change mdl_question_categories.parent to ID of one of the grand-children and finally to the id of the top-level category itself.

      Show
      1. Create several question categories and sub-categories in a course (the more the better). 2. Confirm all categories are displayed OK in a drop-down on question/edit.php?courseid=N page. 3. Edit database by hand to create a loop: in table mdl_question_categories find a top-level (with parent=0) category from your course and change parent to the id of one of the children. 4. Confirm that an exception is thrown, instead of infinite loop and timeout (previous behaviour) 5 Repeat 3 & 4 but change mdl_question_categories.parent to ID of one of the grand-children and finally to the id of the top-level category itself.

    Description

      After an upgrade, we have got some question categories to point to themselves as a parent. That is mdl_question_categories.id == mdl_question_categories.parent.
      This is causing question_categorylist() function to go into infinite loop, until all the resources available (memory) is used up.

      Attachments

        Issue Links

          Activity

            People

              tmuras Tomasz Muras
              tmuras Tomasz Muras
              Tim Hunt Tim Hunt
              Sam Hemelryk Sam Hemelryk
              David Monllaó David Monllaó
              Safat Shahin, Tim Hunt, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/Nov/12