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

Deleting all course categories causes errors due to unset defaultrequestcategory

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.1.6, 2.2.3
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide

      I tested using a brand new install with only the 'Miscellaneous' category

      • Open Settings -> Site administration -> Courses -> Add/edit courses
      • Delete all categories
        • Confirm no errors were shown
      • Click Continue
        • Confirm no errors were shown on the add/edit courses page
        • Confirm that the default category has been re-created
      • Click the 'Add a new course' button
        • Confirm that the page displays without error
      Show
      I tested using a brand new install with only the 'Miscellaneous' category Open Settings -> Site administration -> Courses -> Add/edit courses Delete all categories Confirm no errors were shown Click Continue Confirm no errors were shown on the add/edit courses page Confirm that the default category has been re-created Click the 'Add a new course' button Confirm that the page displays without error
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:

      Description

      When deleting the default course category, the defaultrequestcategory value should be set to the lowest category ID of the remaining categories but isn't due to a variable name bug.

      Additionally, if all categories have been deleted, and the default category is re-created, the defaultrequestcategory is not set again.

        Gliffy Diagrams

          Activity

          Hide
          skodak Petr Skoda added a comment -

          hi, why did you change the case of MIN() sql keyword? The rest looks ok to me.

          Show
          skodak Petr Skoda added a comment - hi, why did you change the case of MIN() sql keyword? The rest looks ok to me.
          Hide
          dobedobedoh Andrew Nicols added a comment -

          Thanks Petr,

          Absolutely no idea how I managed that one! I must have somehow hit ~ whilst yanking the line and not noticed in the diff. Corrected now.

          This should cherry-pick cleanly to:

          • master
          • MOODLE_22_STABLE
          • MOODLE_21_STABLE
          Show
          dobedobedoh Andrew Nicols added a comment - Thanks Petr, Absolutely no idea how I managed that one! I must have somehow hit ~ whilst yanking the line and not noticed in the diff. Corrected now. This should cherry-pick cleanly to: master MOODLE_22_STABLE MOODLE_21_STABLE
          Hide
          poltawski Dan Poltawski added a comment -

          Looks good - please submit

          Show
          poltawski Dan Poltawski added a comment - Looks good - please submit
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          samhemelryk Sam Hemelryk added a comment -

          Thanks Andrew, this has been integrated now (cherry-picked fine)

          Show
          samhemelryk Sam Hemelryk added a comment - Thanks Andrew, this has been integrated now (cherry-picked fine)
          Hide
          rwijaya Rossiani Wijaya added a comment -

          This is working fine

          Thanks.

          Test passed.

          Show
          rwijaya Rossiani Wijaya added a comment - This is working fine Thanks. Test passed.
          Hide
          samhemelryk Sam Hemelryk added a comment -

          Congratulations are in order, you've made it, or at least your code has!
          It's now part of Moodle and both the git and cvs repositories have been updated.

          This issue is being marked as fixed and closed.

          Thank you.

          Show
          samhemelryk Sam Hemelryk added a comment - Congratulations are in order, you've made it, or at least your code has! It's now part of Moodle and both the git and cvs repositories have been updated. This issue is being marked as fixed and closed. Thank you.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/May/12