Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Eloy Lafuente (stronk7) stronk7 authored

Showing 1 changed file with 8 additions and 3 deletions. Show diff stats Hide diff stats

  1. +8 3 mod/glossary/sql.php
11 mod/glossary/sql.php
@@ -154,7 +154,13 @@
154 154 //$params = array();
155 155 $i = 0;
156 156
157   - $concat = $DB->sql_concat('ge.concept', "' '", 'ge.definition',"' '", "COALESCE(al.alias, '')");
  157 + if (empty($fullsearch)) {
  158 + // With fullsearch disabled, look only within concepts and aliases.
  159 + $concat = $DB->sql_concat('ge.concept', "' '", "COALESCE(al.alias, '')");
  160 + } else {
  161 + // With fullsearch enabled, look also within definitions.
  162 + $concat = $DB->sql_concat('ge.concept', "' '", 'ge.definition', "' '", "COALESCE(al.alias, '')");
  163 + }
158 164
159 165 $searchterms = explode(" ",$hook);
160 166
@@ -272,5 +278,4 @@
272 278 }
273 279
274 280 $query = "$sqlwrapheader $sqlselect $sqlfrom $sqlwhere $sqlwrapfooter $sqlorderby";
275   - $allentries = $DB->get_records_sql($query, $params, $limitfrom, $limitnum);
276   -
  281 + $allentries = $DB->get_records_sql($query, $params, $limitfrom, $limitnum);

0 comments on commit 532c3d8

Please sign in to comment.
Something went wrong with that request. Please try again.