-
Bug
-
Resolution: Fixed
-
Blocker
-
2.0.1, 2.0.7, 2.1.4, 2.2.1
-
MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
If a user has the required capabilities to import from some courses, but there exists 250 courses before them that they do not have the capability to import from, the search list on the import page is empty and claims theres no courses to import from, the search box also doesn't appear in this instance.
The problem is this line in 'backup/util/ui/restore_ui_components.php': Line 166:
$resultset = $DB->get_recordset_sql($sql, $params, 0, 250);
The search is clearly hardcoded to only check the first 250 courses. By removing the offset and limit, it properly returns a list of courses the user can import from.
I imagine this was done for performance reasons so we don't end up checking the capabilities across all X number of courses, however simply giving up after a certain number is no good.
I've attached a small patch that simply removes the limit from the query.
- is duplicated by
-
MDL-26938 No matching courses when importing due to max courses limit
- Closed
-
MDL-27095 Course selector in Course-import screen show max. of 10 courses.
- Closed
-
MDL-27154 Course import selector lists only 10 courses, and no pagination
- Closed
-
MDL-29157 list of courses to import from may be empty for some teachers
- Closed
-
MDL-29628 Import course list is not formed correctly: Incorrect results and Performance issues
- Closed