MDL-47613 wiki: allow searching several words

Thanks to Sandeep B for suggested solution
This commit is contained in:
Marina Glancy
2014-10-10 16:35:06 +08:00
parent dcf18dcec6
commit 97ea09ad3a
4 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -111,7 +111,7 @@ abstract class page_wiki {
$PAGE->set_activity_record($wiki);
// the search box
if (!empty($subwiki->id)) {
$search = optional_param('searchstring', null, PARAM_ALPHANUMEXT);
$search = optional_param('searchstring', null, PARAM_TEXT);
$PAGE->set_button(wiki_search_form($cm, $search, $subwiki));
}
}
+1 -1
View File
@@ -310,7 +310,7 @@ class mod_wiki_renderer extends plugin_renderer_base {
array('wid' => $wiki->id, 'title' => $page->title, 'pageid' => $page->id));
break;
case 'search':
$search = optional_param('searchstring', null, PARAM_ALPHANUMEXT);
$search = optional_param('searchstring', null, PARAM_TEXT);
$searchcontent = optional_param('searchwikicontent', 0, PARAM_INT);
$baseurl = new moodle_url('/mod/wiki/search.php',
array('cmid' => $cm->id, 'courseid' => $cm->course,
+1 -1
View File
@@ -26,7 +26,7 @@ require_once($CFG->dirroot . '/mod/wiki/lib.php');
require_once($CFG->dirroot . '/mod/wiki/locallib.php');
require_once($CFG->dirroot . '/mod/wiki/pagelib.php');
$search = optional_param('searchstring', null, PARAM_ALPHANUMEXT);
$search = optional_param('searchstring', null, PARAM_TEXT);
$courseid = optional_param('courseid', 0, PARAM_INT);
$searchcontent = optional_param('searchwikicontent', 0, PARAM_INT);
$cmid = optional_param('cmid', 0, PARAM_INT);
+4
View File
@@ -52,6 +52,10 @@ Feature: Users can search wikis
And I press "Search wikis"
And I should not see "New page created by student1"
And I should see "Collaborative teacher1 page"
And I set the field "searchstring" to "teacher1 page"
And I press "Search wikis"
And I should not see "New page created by student1"
And I should see "Collaborative teacher1 page"
And I log out