Fix autocompletion.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 6 Mar 2010 20:42:25 +0000 (21:42 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 6 Mar 2010 20:42:25 +0000 (21:42 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/direnum.php
modules/search.php

index bc3a856..cce7e39 100644 (file)
@@ -276,7 +276,7 @@ abstract class DirEnumeration
 
         return XDB::iterator('SELECT ' . $this->valfield . ' AS field'
                                        . ($this->ac_distinct ? (', COUNT(DISTINCT ' . $this->ac_unique . ') AS nb') : '')
-                                       . ($this->ac_withid ? (', ' . $this->idfield . ' AS id') : '') . '
+                                       . ($this->ac_withid ? (', ' . $this->from . '.' . $this->idfield . ' AS id') : '') . '
                                 FROM ' . $this->from . '
                                      ' . $this->ac_join . '
                                WHERE ' . $where . '
index c0b2791..a0057ef 100644 (file)
@@ -206,7 +206,7 @@ class SearchModule extends PLModule
             'nationaliteTxt'     => DirEnum::NATIONALITIES,
             'schoolTxt'          => DirEnum::EDUSCHOOLS,
         );
-        if (!array_key_exists($enums, $type)) {
+        if (!array_key_exists($type, $enums)) {
             exit();
         }