mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 14:02:32 +02:00
MDL-53247 search: allow search to be configured before enabled
The seach manager no longer checks if search is enabled before providing an instance. It's up to the callers to do the access control.
This commit is contained in:
parent
03b8b55f10
commit
7c7757185a
@ -37,8 +37,6 @@ echo $OUTPUT->heading($pagetitle);
|
||||
if (\core_search\manager::is_global_search_enabled() === false) {
|
||||
$renderer = $PAGE->get_renderer('core_search');
|
||||
echo $renderer->render_search_disabled();
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
$renderer = $PAGE->get_renderer('report_search');
|
||||
|
@ -99,10 +99,6 @@ class manager {
|
||||
/**
|
||||
* Returns an initialised \core_search instance.
|
||||
*
|
||||
* It requires global search to be enabled. Use \core_search\manager::is_global_search_enabled
|
||||
* to verify it is enabled.
|
||||
*
|
||||
* @throws \moodle_exception
|
||||
* @throws \core_search\engine_exception
|
||||
* @return \core_search\manager
|
||||
*/
|
||||
@ -114,10 +110,6 @@ class manager {
|
||||
return static::$instance;
|
||||
}
|
||||
|
||||
if (!static::is_global_search_enabled()) {
|
||||
throw new \moodle_exception('globalsearchdisabled', 'search');
|
||||
}
|
||||
|
||||
if (!$engine = static::search_engine_instance()) {
|
||||
throw new \core_search\engine_exception('enginenotfound', 'search', '', $CFG->searchengine);
|
||||
}
|
||||
|
@ -34,14 +34,6 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
require_login(null, false);
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
|
||||
if (!\core_search\manager::is_global_search_enabled()) {
|
||||
throw new moodle_exception('globalsearchdisabled', 'search');
|
||||
}
|
||||
|
||||
if ($CFG->searchengine !== 'solr') {
|
||||
throw new moodle_exception('solrnotselected', 'search_solr');
|
||||
}
|
||||
|
||||
$schema = new \search_solr\schema();
|
||||
$schema->setup();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user