mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-55287_master-fix' of git://github.com/dmonllao/moodle
This commit is contained in:
commit
fdf50e35b6
@ -47,7 +47,7 @@ $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'] = 'Engine {$a} not installed.';
|
||||
$string['enginenotinstalled'] = 'Engine {$a} is 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';
|
||||
|
@ -9741,7 +9741,11 @@ class admin_setting_searchsetupinfo extends admin_setting {
|
||||
array('href' => $url));
|
||||
// Check the engine status.
|
||||
$searchengine = \core_search\manager::search_engine_instance();
|
||||
$serverstatus = $searchengine->is_server_ready();
|
||||
try {
|
||||
$serverstatus = $searchengine->is_server_ready();
|
||||
} catch (\moodle_exception $e) {
|
||||
$serverstatus = $e->getMessage();
|
||||
}
|
||||
if ($serverstatus === true) {
|
||||
$status = html_writer::tag('span', get_string('yes'), array('class' => 'statusok'));
|
||||
} else {
|
||||
|
@ -1160,6 +1160,10 @@ class engine extends \core_search\engine {
|
||||
'timeout' => !empty($this->config->server_timeout) ? $this->config->server_timeout : '30'
|
||||
);
|
||||
|
||||
if (!class_exists('\SolrClient')) {
|
||||
throw new \core_search\engine_exception('enginenotinstalled', 'search', '', 'solr');
|
||||
}
|
||||
|
||||
$client = new \SolrClient($options);
|
||||
|
||||
if ($client === false && $triggerexception) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user