Bug 8027 - Wrong order for parameters in Z39.50 SQL INSERT
Summary: Wrong order for parameters in Z39.50 SQL INSERT
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Z39.50 / SRU / OpenSearch Servers (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low major (vote)
Assignee: Adrien SAURAT
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-30 10:09 UTC by Adrien SAURAT
Modified: 2013-12-05 19:57 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
proposed patch (843 bytes, patch)
2012-04-30 10:16 UTC, Adrien SAURAT
Details | Diff | Splinter Review
Bug 8027: fix param order for z3950 INSERT (1.19 KB, patch)
2012-04-30 10:54 UTC, Dobrica Pavlinusic
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Adrien SAURAT 2012-04-30 10:09:20 UTC
In the z3950servers.pl page, the INSERT for new servers is prepared like this :
===================================
INSERT INTO z3950servers
 (host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout)
 VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
===================================

but then executed like this :
===================================
        $sth->execute(
            $input->param( 'host' ),
            $input->param( 'port' ),
            $input->param( 'db' ),
            $input->param( 'userid' ),
            $input->param( 'password' ),
            $input->param( 'searchfield' ),
            $checked,
            $input->param( 'rank' ),
            $input->param( 'syntax' ),
            $input->param( 'timeout' ),
            $input->param( 'encoding' ) );
	}
===================================

The last parameters, timeout and encoding, are not in the same order.
Comment 1 Adrien SAURAT 2012-04-30 10:16:05 UTC Comment hidden (obsolete)
Comment 2 Dobrica Pavlinusic 2012-04-30 10:54:40 UTC
Created attachment 9365 [details] [review]
Bug 8027: fix param order for z3950 INSERT

In the z3950servers.pl order of columns which are inserted
for new server is wrong, which results in empty timeout
and encoding values when new server is added.

Test scenario:

1. Open Z39.50 server administration
2. add new server with encoding and timeout
3. save server and verify that it has encoding and timeout

Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Comment 3 Dobrica Pavlinusic 2012-04-30 10:55:24 UTC
I added test scenario and fixed bug number in commit message.
Comment 4 Ian Walls 2012-05-01 14:37:35 UTC
Switches the params to match the order of the INSERT statement.  Marking Passed QA.