mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-62705 Global Search: results order selection does not display
As of 3.5 a search plugin can define the result orders it supports. When a search plugin defines multiple sort orders and the search is conducted without a context (no context query param in the URL), the code to load the available sort orders from the enabled search backend is never called. This patch gets the supported search orders for the enabled search engine regardless of context being provided or not. As prior, the search order selection will not display if the only result order option is relevance.
This commit is contained in:
parent
9e7c397889
commit
784ed31ea0
@ -76,9 +76,10 @@ if ($contextid) {
|
||||
$customdata['withincourseid'] = $coursecontext->instanceid;
|
||||
}
|
||||
|
||||
// Get available ordering options from search engine.
|
||||
$customdata['orderoptions'] = $search->get_engine()->get_supported_orders($context);
|
||||
}
|
||||
// Get available ordering options from search engine.
|
||||
$customdata['orderoptions'] = $search->get_engine()->get_supported_orders($context);
|
||||
|
||||
$mform = new \core_search\output\form\search(null, $customdata);
|
||||
|
||||
$data = $mform->get_data();
|
||||
|
Loading…
x
Reference in New Issue
Block a user