[Bug 6579] New: getalert SQL invalid for KOHA_USER
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6579 Bug #: 6579 Summary: getalert SQL invalid for KOHA_USER Classification: Unclassified Change sponsored?: --- Product: Koha Version: rel_3_0 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P5 Component: Notices AssignedTo: henridamien@koha-fr.org ReportedBy: ohiocore@gmail.com QAContact: koha-bugs@lists.koha-community.org The code for getalert in C4::Letters fails to account for one important case. While the POD says "all parameters NON mandatory", the result of NO arguments produces invalid SQL. The errors in the log look like: [error] [client 71.64.0.171] [Mon Jul 11 19:54:12 2011] opac-user.pl: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 at /usr/share/koha/lib/C4/Letters.pm line 197, <DATA> line 522., referer: https://my.koha.edu/cgi-bin/koha/opac-user.pl [error] [client 71.64.0.171] [Mon Jul 11 19:54:12 2011] opac-user.pl: DBD::mysql::st fetchall_arrayref failed: fetch() without execute() at /usr/share/koha/lib/C4/Letters.pm line 198, <DATA> line 522., referer: https://my.koha.edu/cgi-bin/koha/opac-user.pl If you look at the logic, you'll agree that "SELECT * FROM alert WHERE" is not a valid SQL query. Code should assemble bind name/value pairs in a hash instead of appending to the query and pushing onto an array. Then build the WHERE clause at the end only when hash is populated. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6579 --- Comment #1 from Joe Atzberger <ohiocore@gmail.com> 2011-07-12 04:02:33 UTC --- Alternatively, the standard hack of "SELECT ... WHERE 1 AND ..." could be used here. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6579 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- You are not allowed to use Koha with the DB user. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. You are the QA Contact for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org