Moodle
  1. Moodle
  2. MDL-32004

Deleting all course categories causes errors due to unset defaultrequestcategory

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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:
    • Rank:
      38675

      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.

        Activity

        Hide
        Petr Škoda added a comment -

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

        Show
        Petr Škoda added a comment - hi, why did you change the case of MIN() sql keyword? The rest looks ok to me.
        Hide
        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
        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
        Dan Poltawski added a comment -

        Looks good - please submit

        Show
        Dan Poltawski added a comment - Looks good - please submit
        Hide
        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
        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
        Sam Hemelryk added a comment -

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

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

        This is working fine

        Thanks.

        Test passed.

        Show
        Rossiani Wijaya added a comment - This is working fine Thanks. Test passed.
        Hide
        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
        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: