diff --git a/admin/searchareas.php b/admin/searchareas.php index 884d5b8670c..dcbc7cb0bfd 100644 --- a/admin/searchareas.php +++ b/admin/searchareas.php @@ -95,7 +95,7 @@ if (empty($searchmanagererror)) { } if (!empty($searchmanagererror)) { - $errorstr = get_string($searchmanagererror->errorcode, $searchmanagererror->module); + $errorstr = get_string($searchmanagererror->errorcode, $searchmanagererror->module, $searchmanagererror->a); echo $OUTPUT->notification($errorstr, \core\output\notification::NOTIFY_ERROR); } else { echo $OUTPUT->notification(get_string('indexinginfo', 'admin'), \core\output\notification::NOTIFY_INFO); diff --git a/lang/en/search.php b/lang/en/search.php index bfe296c2847..f9e4da97bd3 100644 --- a/lang/en/search.php +++ b/lang/en/search.php @@ -47,7 +47,8 @@ $string['documentsinindex'] = 'Documents in index'; $string['duration'] = 'Duration'; $string['emptydatabaseerror'] = 'Database table is not present, or contains no index records.'; $string['enginenotfound'] = 'Engine {$a} not found.'; -$string['enginenotinstalled'] = '{$a} not installed.'; +$string['enginenotinstalled'] = 'Engine {$a} not installed.'; +$string['enginenotselected'] = 'You have not selected any search engine.'; $string['engineserverstatus'] = 'The search engine is not available. Please contact your administrator.'; $string['enteryoursearchquery'] = 'Enter your search query'; $string['errors'] = 'Errors'; diff --git a/search/classes/manager.php b/search/classes/manager.php index cf164b8d0d9..6478c0e4c43 100644 --- a/search/classes/manager.php +++ b/search/classes/manager.php @@ -122,6 +122,10 @@ class manager { return static::$instance; } + if (empty($CFG->searchengine)) { + throw new \core_search\engine_exception('enginenotselected', 'search'); + } + if (!$engine = static::search_engine_instance()) { throw new \core_search\engine_exception('enginenotfound', 'search', '', $CFG->searchengine); }