Hello,
I wrote a custom PHP script to create course categories from a CSV file by directly inserting records into the mdl_course_categories table. The script seems to work fine, but the categories added by the script do not appear under "Site administration" > "Courses" > "Add/edit courses". We're using Moodle 2.5.
A little more detail: I created a top-level category called "UC" which all of the new categories are created under (some are nested more deeply than others, but all have "UC" as the top-most category). Here's what shows up in the database:
mysql> SELECT * FROM mdl_course_categories WHERE path LIKE '/17%';
+-----+-------------------+---------------+-------------+-------------------+--------+-----------+-------------+---------+------------+--------------+-------+-----------------+-------+
| id | name | idnumber | description | descriptionformat | parent | sortorder | coursecount | visible | visibleold | timemodified | depth | path | theme |
+-----+-------------------+---------------+-------------+-------------------+--------+-----------+-------------+---------+------------+--------------+-------+-----------------+-------+
| 17 | UC | UC | | 1 | 0 | 150000 | 0 | 1 | 1 | 1386350352 | 1 | /17 | NULL |
| 671 | Fall 2013 | 201380 | | 1 | 17 | 160000 | 0 | 1 | 1 | 1386350352 | 2 | /17/671 | NULL |
| 672 | Arts and Sciences | 201380-AS | | 1 | 671 | 161000 | 0 | 1 | 1 | 1386350352 | 3 | /17/671/672 | NULL |
| 673 | ANT | 201380-AS-ANT | | 1 | 672 | 161100 | 0 | 1 | 1 | 1386350352 | 4 | /17/671/672/673 | NULL |
| 674 | ARB | 201380-AS-ARB | | 1 | 672 | 161200 | 0 | 1 | 1 | 1386350352 | 4 | /17/671/672/674 | NULL |
| 675 | BIO | 201380-AS-BIO | | 1 | 672 | 161300 | 0 | 1 | 1 | 1386350352 | 4 | /17/671/672/675 | NULL |
| 676 | CHE | 201380-AS-CHE | | 1 | 672 | 161400 | 0 | 1 | 1 | 1386350352 | 4 | /17/671/672/676 | NULL |
| 677 | COM | 201380-AS-COM | | 1 | 672 | 161500 | 0 | 1 | 1 | 1386350352 | 4 | /17/671/672/677 | NULL |
| 678 | CSC | 201380-AS-CSC | | 1 | 672 | 161600 | 0 | 1 | 1 | 1386350352 | 4 | /17/671/672/678 | NULL |
| 679 | ENG | 201380-AS-ENG | | 1 | 672 | 161700 | 0 | 1 | 1 | 1386350352 | 4 | /17/671/672/679 | NULL |
| 680 | ENV | 201380-AS-ENV | | 1 | 672 | 161800 | 0 | 1 | 1 | 1386350352 | 4 | /17/671/672/680 | NULL |
+-----+-------------------+---------------+-------------+-------------------+--------+-----------+-------------+---------+------------+--------------+-------+-----------------+-------+
11 rows in set (0.00 sec)
Even after logging out and clearing my browser cache, I still only see the top-level "UC" category and none of the new sub-categories. Is there something I'm missing? Any help or general pointers would be greatly appreciated.
Thanks!