Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-25655 glossary: non full searches now working.

In the process of updting the module from 1.9 to
2.0 the (non) full search feature was lost without notice.

This restitutes it with the same behavior present in 1.9:

- fullsearch disabled: look into concepts and aliases.
- fullsearch enabled (default): look also into definitions.
  • Loading branch information...
commit 0713cc584d5baa223e46edfdfe7df6516e2e5a54 1 parent 29f8c09
@stronk7 stronk7 authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 mod/glossary/sql.php
View
11 mod/glossary/sql.php
@@ -154,7 +154,13 @@
//$params = array();
$i = 0;
- $concat = $DB->sql_concat('ge.concept', "' '", 'ge.definition',"' '", "COALESCE(al.alias, '')");
+ if (empty($fullsearch)) {
+ // With fullsearch disabled, look only within concepts and aliases.
+ $concat = $DB->sql_concat('ge.concept', "' '", "COALESCE(al.alias, '')");
+ } else {
+ // With fullsearch enabled, look also within definitions.
+ $concat = $DB->sql_concat('ge.concept', "' '", 'ge.definition', "' '", "COALESCE(al.alias, '')");
+ }
$searchterms = explode(" ",$hook);
@@ -272,5 +278,4 @@
}
$query = "$sqlwrapheader $sqlselect $sqlfrom $sqlwhere $sqlwrapfooter $sqlorderby";
- $allentries = $DB->get_records_sql($query, $params, $limitfrom, $limitnum);
-
+ $allentries = $DB->get_records_sql($query, $params, $limitfrom, $limitnum);
Please sign in to comment.
Something went wrong with that request. Please try again.