Commit 4f3d5dfc authored by Eloy Lafuente's avatar Eloy Lafuente
Browse files

Merge branch 'MDL-69906-master-searchsimpledb' of git://github.com/mudrd8mz/moodle into master

parents 6b3774b7 b295a888
......@@ -11118,7 +11118,7 @@ class admin_setting_searchsetupinfo extends admin_setting {
* @return string
*/
public function output_html($data, $query='') {
global $CFG, $OUTPUT;
global $CFG, $OUTPUT, $ADMIN;
$return = '';
$brtag = html_writer::empty_tag('br');
......@@ -11180,9 +11180,13 @@ class admin_setting_searchsetupinfo extends admin_setting {
$row[0] = '3. ' . get_string('setupsearchengine', 'admin');
$row[1] = html_writer::tag('span', get_string('no'), array('class' => 'badge badge-danger'));
} else {
$url = new moodle_url('/admin/settings.php?section=search' . $CFG->searchengine);
$row[0] = '3. ' . html_writer::tag('a', get_string('setupsearchengine', 'admin'),
array('href' => $url));
if ($ADMIN->locate('search' . $CFG->searchengine)) {
$url = new moodle_url('/admin/settings.php?section=search' . $CFG->searchengine);
$row[0] = '3. ' . html_writer::link($url, get_string('setupsearchengine', 'core_admin'));
} else {
$row[0] = '3. ' . get_string('setupsearchengine', 'core_admin');
}
// Check the engine status.
$searchengine = \core_search\manager::search_engine_instance();
try {
......
@core @core_search
Feature: Plugins > Search > Search setup contains Setup search engine only if the target section actually exists
In order to set up the selected search engine
As an admin
I need to be able to click the link 'Setup search engine' but only if the target section actually exists
Scenario: Selected search engine has an admin section
Given the following config values are set as admin:
| enableglobalsearch | 1 |
| searchengine | solr |
And I log in as "admin"
When I navigate to "Plugins > Search" in site administration
Then "Setup search engine" "link" should exist
Scenario: Selected search engine does not have an admin section
Given the following config values are set as admin:
| enableglobalsearch | 1 |
| searchengine | simpledb |
And I log in as "admin"
When I navigate to "Plugins > Search" in site administration
Then I should see "Setup search engine"
And "Setup search engine" "link" should not exist
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment