Bug 23242 - Error when adding new Z39.50/SRU server in DB strict mode
Summary: Error when adding new Z39.50/SRU server in DB strict mode
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Z39.50 / SRU / OpenSearch Servers (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks: 17258
  Show dependency treegraph
 
Reported: 2019-07-01 10:56 UTC by Nick Clemens
Modified: 2020-11-30 21:45 UTC (History)
5 users (show)

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


Attachments
Bug 23242: Fix insert of Z3950 servers with strict SQL modes (3.14 KB, patch)
2019-08-04 17:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23242: Fix insert of Z3950 servers with strict SQL modes (3.19 KB, patch)
2019-08-13 06:14 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23242: Fix insert of Z3950 servers with strict SQL modes (3.29 KB, patch)
2019-08-16 06:20 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2019-07-01 10:56:32 UTC
Unless you select 'preselected' and set 'rank' and 'timeout'

DBIx::Class::Storage::DBI::_dbh_execute(): Incorrect integer value: '' for column 'checked' at row 1 at /kohadevbox/koha/admin/z3950servers.pl line 82
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77
Comment 1 Jonathan Druart 2019-08-04 17:53:29 UTC
Created attachment 91952 [details] [review]
Bug 23242: Fix insert of Z3950 servers with strict SQL modes

If strict SQL modes are set, the insertion of a new Z3950 server can
fail.

DBIx::Class::Storage::DBI::_dbh_execute(): Incorrect integer value: ''
for column 'checked' at row 1 at
/home/vagrant/kohaclone/admin/z3950servers.pl line 82

Using Koha::Z3950Servers fixes the issue (handled from
Koha::Object->store)

Test plan:
- Turn the strict SQL modes on (config strict_sql_modes)
- Create a new Z3950 server filling only the mandatory fields.
=> Without this patch you will get the failure, with this patch applied
the server will be inserted sucessfully
- Delete it
=> No regression should be found
- Search for servers
=> No regression should be found (the search is a start-with, LIKE "$pattern%")
Comment 2 Katrin Fischer 2019-08-13 06:14:09 UTC
Created attachment 92170 [details] [review]
Bug 23242: Fix insert of Z3950 servers with strict SQL modes

If strict SQL modes are set, the insertion of a new Z3950 server can
fail.

DBIx::Class::Storage::DBI::_dbh_execute(): Incorrect integer value: ''
for column 'checked' at row 1 at
/home/vagrant/kohaclone/admin/z3950servers.pl line 82

Using Koha::Z3950Servers fixes the issue (handled from
Koha::Object->store)

Test plan:
- Turn the strict SQL modes on (config strict_sql_modes)
- Create a new Z3950 server filling only the mandatory fields.
=> Without this patch you will get the failure, with this patch applied
the server will be inserted sucessfully
- Delete it
=> No regression should be found
- Search for servers
=> No regression should be found (the search is a start-with, LIKE "$pattern%")

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 3 Marcel de Rooy 2019-08-16 06:20:01 UTC
Created attachment 92256 [details] [review]
Bug 23242: Fix insert of Z3950 servers with strict SQL modes

If strict SQL modes are set, the insertion of a new Z3950 server can
fail.

DBIx::Class::Storage::DBI::_dbh_execute(): Incorrect integer value: ''
for column 'checked' at row 1 at
/home/vagrant/kohaclone/admin/z3950servers.pl line 82

Using Koha::Z3950Servers fixes the issue (handled from
Koha::Object->store)

Test plan:
- Turn the strict SQL modes on (config strict_sql_modes)
- Create a new Z3950 server filling only the mandatory fields.
=> Without this patch you will get the failure, with this patch applied
the server will be inserted sucessfully
- Delete it
=> No regression should be found
- Search for servers
=> No regression should be found (the search is a start-with, LIKE "$pattern%")

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Martin Renvoize 2019-08-16 11:21:21 UTC
Nice work!

Pushed to master for 19.11.00
Comment 5 Fridolin Somers 2019-09-02 14:40:57 UTC
Pushed to 19.05.x for 19.05.04
Comment 6 Lucas Gass 2019-09-17 20:27:15 UTC
backported to 18.11.x for 18.11.10