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

This commit is contained in:
Dan Poltawski 2016-07-27 07:58:33 +01:00
commit fdf50e35b6
3 changed files with 10 additions and 2 deletions

View File

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

View File

@ -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 {

View File

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