From b8c2e4fa780e49c69f05ccdb08546a0198891870 Mon Sep 17 00:00:00 2001 From: bdaloukas Date: Tue, 4 Jul 2017 19:50:07 +0300 Subject: [PATCH] Message with common problems --- mod_form.php | 9 ++++++--- version.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mod_form.php b/mod_form.php index 3e3c138..1637fef 100644 --- a/mod_form.php +++ b/mod_form.php @@ -407,15 +407,18 @@ class mod_game_mod_form extends moodleform_mod { global $CFG, $DB; if (count( $a) == 0) { - $select = 'glossaryid=-1'; + $select = 'gc.glossaryid = -1'; } else if (count($a) == 1) { - $select = 'glossaryid='.reset( $a); + foreach ($a as $id => $name) { + $select = 'gc.glossaryid = '.$id; + break; + } } else { $select = ''; foreach ($a as $id => $name) { $select .= ','.$id; } - $select = 'g.id IN ('.substr( $select, 1).')'; + $select = 'gc.glossaryid IN ('.substr( $select, 1).')'; } $a = array(); diff --git a/version.php b/version.php index 9fce04d..2801390 100644 --- a/version.php +++ b/version.php @@ -35,7 +35,7 @@ if (!isset( $plugin)) { } $plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics). -$plugin->version = 2017070301; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2017070302; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2010112400; // Requires Moodle 2.0. $plugin->cron = 0; // Period for cron to check this module (secs). $plugin->release = '2017-07-03';