-
Bug
-
Resolution: Fixed
-
Major
-
3.5, 3.7.4, 3.8.1
-
MOODLE_35_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
-
MOODLE_310_STABLE, MOODLE_39_STABLE
-
Steps to recreate -
- enable global search on Moodle with all settings left as default
- create a new course "veggies" and a label "cabbage"
- give the course:view permission to "Authenticated users" for "veggies"
- log in as a non-admin user, not registered on any courses
- go into the "veggies" course and search for "cabbage" - no results, as expected, because "searchable courses" is still set to the default of "search within enrolled courses only"
- from the "search within" drop-down menu choose "course: veggies" and search again
Result -
Coding error detected, it must be fixed by a programmer: moodle_database::get_in_or_equal() does not accept empty arrays
Stack trace:
- line 770 of /lib/dml/moodle_database.php: coding_exception thrown
- line 593 of /search/classes/manager.php: call to moodle_database->get_in_or_equal()
- line 778 of /search/classes/manager.php: call to core_search\manager->get_areas_user_accesses()
- line 684 of /search/classes/manager.php: call to core_search\manager->search()
- line 150 of /search/index.php: call to core_search\manager->paged_search()
The error doesn't occur if you've changed "searchable courses" to "search within all courses the user can access"
- is duplicated by
-
MDL-70251 Search: Error if user filters results to a course they are not enrolled in
- Closed