From 8c689418f7fffe9c54d77aeb5406c1fe55576570 Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Thu, 7 Nov 2024 09:57:26 +0100 Subject: [PATCH] Bugfixes --- application/libraries/SearchBarLib.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/application/libraries/SearchBarLib.php b/application/libraries/SearchBarLib.php index 630f31ecf..b9c71b16b 100644 --- a/application/libraries/SearchBarLib.php +++ b/application/libraries/SearchBarLib.php @@ -68,7 +68,6 @@ class SearchBarLib /** * It performes the search of the given search string using the specified search types - * TODO(chris): permissions * * @param string $searchstring * @param array $types (optional) @@ -498,9 +497,8 @@ class SearchBarLib SELECT " . $this->_formatPrimarykeys($table_config['primarykey'], $table_config['table']) . " FROM " . $table_config['table'] . " - " . $this->_makeJoin($field_config['join']) . " + " . $this->_makeJoin($field_config['join'] ?? '') . " WHERE "; - // TODO(chris): equals and equal-int could be IN () statement??? foreach ($words as $word) { $sql[] = $field_sql . $this->_makeCompareBool($field_config['comparison'], $field_config['field'], $word); } @@ -508,10 +506,10 @@ class SearchBarLib $or_select[] = " SELECT - " . $table_config['table']($table_config['primarykey']) . ", + " . $this->_formatPrimarykeys($table_config['primarykey'], $table_config['table']) . ", 1.0 AS rank FROM " . $table_config['table'] . " - WHERE prestudent_id NOT IN (" . implode(" UNION ", $sql) . ")"; + WHERE " . $table_config['primarykey'] . " NOT IN (" . implode(" UNION ", $sql) . ")"; } else { $current_select = false; $count = 0;