In backup/util/ui/restore_ui_components.php function search(), get_recordset_sql is limited to 250 rows. The import utility in courses generates a search query like this one:
SELECT c.id,c.fullname,c.shortname,c.visible,c.sortorder , ctx.id AS ctxid, ctx.path AS ctxpath, ctx.depth AS ctxdepth, ctx.contextlevel AS ctxlevel, ctx.instanceid AS ctxinstance FROM mdl_course c LEFT JOIN mdl_context ctx ON (ctx.instanceid = c.id AND ctx.contextlevel = 50) WHERE (LOWER(c.fullname) LIKE LOWER('%%') COLLATE utf8_bin ESCAPE '
' OR LOWER(c.shortname) LIKE LOWER('%%') COLLATE utf8_bin ESCAPE '
') AND c.id <> 1 ORDER BY c.sortorder;
Which returns all courses in the site. So if you happen to have more than 250 courses, teachers won't get a single one in the first 250, therefore an empty array will be returned, and a message saying "No matching courses".
This is beacuse the context is checked after creating the search. I modified the code to get 2500 and 5500 (more than the 4870 we have), and worked, but it was REALLY slow.
- duplicates
-
MDL-26037 Import search list only checks first 250 courses to list
-
- Closed
-