6.0.0-beta6
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
3/30/26
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#6552] DB Error: syntax error when searching with no criteria
*
Your Email Address
*
Spam protection
Enter the letters below:
. .. .. .. ..___. |\/|| || ||_/ _/ | ||__||/\|| \./__.
Comment
> As a user with hermes:review permission, click Search in the top menu > bar, then -- without selecting any criteria -- click Search > immediately. A "DB Error: syntax error" is returned, when I expect > to see all entered hours. > > > > In non-reviewer cases, the "employee" criterion is always passed > implicitly, as that's the filter used to limit that person's search. > Thus inspecting $sql at hermes/lib/Driver/sql.php:280 shows $filters > as: > > array(2) { > > ["employee"]=> > > string(21) "pmvaleri@ideacode.com" > > ["link_page"]=> > > string(10) "search.php" > > } > > > > When doing that same query as a reviewer, however, $filters is: > > array(1) { > > ["link_page"]=> > > string(10) "search.php" > > } > > > > The problem is that $filters contains one entry, which causes the > WHERE clause keyword to be inserted into the SQL statement, but then > no actual criteria are added after the WHERE clause, since link_page > is not a criterion but an option being passed in for the function to > use otherwise. > > > > The best fix is to insert the WHERE keyword only when certain there's > actually a where clause. Unified diff attached.
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers