[Koha-bugs] [Bug 6579] New: getalert SQL invalid for KOHA_USER

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jul 12 06:00:32 CEST 2011


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 at koha-fr.org
        ReportedBy: ohiocore at gmail.com
         QAContact: koha-bugs at 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.


More information about the Koha-bugs mailing list