Merge branch 'MDL-55287_master' of git://github.com/dmonllao/moodle

This commit is contained in:
Dan Poltawski 2016-07-25 15:55:48 +01:00
commit 5d21ea9d3b
3 changed files with 7 additions and 2 deletions

View File

@ -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);

View File

@ -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';

View File

@ -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);
}