Bug 8027

Summary: Wrong order for parameters in Z39.50 SQL INSERT
Product: Koha Reporter: Adrien SAURAT <adrien.saurat>
Component: Z39.50 / SRU / OpenSearch ServersAssignee: Adrien SAURAT <adrien.saurat>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P5 - low CC: chris, dpavlin, koha.sekjal, paul.poulain
Version: 3.8   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: proposed patch
Bug 8027: fix param order for z3950 INSERT

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.