Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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 532c3d8803aac46b02a4b563d5e94206d98f24e4 1 parent d43ba3c
@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.