Moodle
  1. Moodle
  2. MDL-37105

Miscellaneous category cannot be opened after courses are created by log in

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4.1
    • Component/s: Course, Navigation
    • Labels:
    • Environment:
      SLES11 release 2
    • Database:
      PostgreSQL
    • Testing Instructions:
      Hide

      1/ install moodle
      2/ create more than 20 courses in Misc category (may be less if you lower $CFG->navcourselimit)
      3/ try to add new course - verify exception is not triggered any more

      Show
      1/ install moodle 2/ create more than 20 courses in Misc category (may be less if you lower $CFG->navcourselimit) 3/ try to add new course - verify exception is not triggered any more
    • Workaround:
      Hide

      Create a new category (besides Miscellaneous) and the problem will disappear.

      Show
      Create a new category (besides Miscellaneous) and the problem will disappear.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w51_MDL-37105_m25_catlimit

      Description

      Error message: "Coding error detected, it must be fixed by a programmer: moodle_database::get_in_or_equal() does not accept empty arrays"

      This has happened with a setup identical to previous ldap setup, which worked on 2.2 and 2.3.
      It happens if I upgrade a 2.3.3 to 2.4 or if I make a fresh install.

      Courses are created at log in on our server, we have used this setup for years with no problems.
      Setup between ldap and moodle has not been changed on upgrade..

        Gliffy Diagrams

        1. mdl_course_categories.sql
          0.5 kB
          chester folming
        2. mdl_course.sql
          19 kB
          chester folming

          Activity

          Hide
          Petr Skoda added a comment -

          Could you please enable developer debug mode and copy paste the stack trace? Thanks

          Show
          Petr Skoda added a comment - Could you please enable developer debug mode and copy paste the stack trace? Thanks
          Hide
          chester folming added a comment -

          (Build: 20121208)

          Show
          chester folming added a comment - (Build: 20121208)
          Hide
          chester folming added a comment -

          Debug info:
          Error code: codingerror
          Stack trace:

          line 646 of /lib/dml/moodle_database.php: coding_exception thrown
          line 1666 of /lib/navigationlib.php: call to moodle_database->get_in_or_equal()
          line 1101 of /lib/navigationlib.php: call to global_navigation->load_all_categories()
          line 3114 of /lib/navigationlib.php: call to global_navigation->initialise()
          line 700 of /lib/pagelib.php: call to settings_navigation->__construct()
          line 717 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
          line 6193 of /lib/adminlib.php: call to moodle_page->__get()
          line 194 of /course/category.php: call to admin_externalpage_setup()

          Show
          chester folming added a comment - Debug info: Error code: codingerror Stack trace: line 646 of /lib/dml/moodle_database.php: coding_exception thrown line 1666 of /lib/navigationlib.php: call to moodle_database->get_in_or_equal() line 1101 of /lib/navigationlib.php: call to global_navigation->load_all_categories() line 3114 of /lib/navigationlib.php: call to global_navigation->initialise() line 700 of /lib/pagelib.php: call to settings_navigation->__construct() line 717 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav() line 6193 of /lib/adminlib.php: call to moodle_page->__get() line 194 of /course/category.php: call to admin_externalpage_setup()
          Hide
          Petr Skoda added a comment -

          Looks like there is a major bug in course creation in some auth/enrol code. Could you please verify the parent, path and depth fields in table course_categories and category field in the course table? I suppose one of these contains invalid data. It should be a lot easier to fix/reproduce if we know exactly what went wrong.

          Show
          Petr Skoda added a comment - Looks like there is a major bug in course creation in some auth/enrol code. Could you please verify the parent, path and depth fields in table course_categories and category field in the course table? I suppose one of these contains invalid data. It should be a lot easier to fix/reproduce if we know exactly what went wrong.
          Hide
          chester folming added a comment -

          Will the uploads above answer your request?

          Show
          chester folming added a comment - Will the uploads above answer your request?
          Hide
          Petr Skoda added a comment -

          Thanks a lot, the sql data looks ok, it must be a navigation issue then, reassigning to Sam.

          Show
          Petr Skoda added a comment - Thanks a lot, the sql data looks ok, it must be a navigation issue then, reassigning to Sam.
          Hide
          chester folming added a comment - - edited

          Important update!

          I created another category and then I could open Miscellaneous (and move courses), so it must be a minor mistake on fresh installs.
          This explains how it has gone unnoticed during test.

          Since it is anyhow rather disturbing, I will let it be up to you to change this to "minor".

          Show
          chester folming added a comment - - edited Important update! I created another category and then I could open Miscellaneous (and move courses), so it must be a minor mistake on fresh installs. This explains how it has gone unnoticed during test. Since it is anyhow rather disturbing, I will let it be up to you to change this to "minor".
          Hide
          Sam Hemelryk added a comment -

          Thanks for the report Chester, and thank you Petr for quickly ascertaining the area leading to the issue.
          I've marked this triaged now and have added it to our queue.

          Many thanks
          Sam

          Show
          Sam Hemelryk added a comment - Thanks for the report Chester, and thank you Petr for quickly ascertaining the area leading to the issue. I've marked this triaged now and have added it to our queue. Many thanks Sam
          Hide
          Petr Skoda added a comment -

          Thanks for the report and cooperation!

          Show
          Petr Skoda added a comment - Thanks for the report and cooperation!
          Hide
          Sam Hemelryk added a comment -

          Thanks Petr - this has been integrated now.

          Show
          Sam Hemelryk added a comment - Thanks Petr - this has been integrated now.
          Hide
          Mark Nelson added a comment -

          I wrote a script that generated 20 courses, would then manually create another and then attempted to view the category listing. I checked to see if I could replicate this issue on stable and was. I then went through the same steps on integration and could not replicate. Passing.

          Show
          Mark Nelson added a comment - I wrote a script that generated 20 courses, would then manually create another and then attempted to view the category listing. I checked to see if I could replicate this issue on stable and was. I then went through the same steps on integration and could not replicate. Passing.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          And your fantastic code has met core, hope they become good friends for a long period.

          Closing, thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - And your fantastic code has met core, hope they become good friends for a long period. Closing, thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: