Bug 15875 - Refactor DB accessors from "z39.50 admin setup / z3950servers.pl" to C4::Breeding
Summary: Refactor DB accessors from "z39.50 admin setup / z3950servers.pl" to C4::Bree...
Status: RESOLVED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Z39.50 / SRU / OpenSearch Servers (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-22 10:32 UTC by Olli-Antti Kivilahti
Modified: 2023-08-28 21:25 UTC (History)
1 user (show)

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


Attachments
Bug 15875 - Refactor DB accessors from "z39.50 admin setup / z3950servers.pl" to C4::Breeding (11.39 KB, patch)
2016-02-22 10:38 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Olli-Antti Kivilahti 2016-02-22 10:32:28 UTC
z3950servers.pl is a horrible mess of hard SQL in the perl script/Controller-layer.
Also a lack of proper internal API for mutating Z3950servers makes writing tests much harder.

This patch refactors z3950servers.pl by moving SQL to C4::Breeding under proper accessors.
Comment 1 Olli-Antti Kivilahti 2016-02-22 10:38:40 UTC
Created attachment 48268 [details] [review]
Bug 15875 - Refactor DB accessors from "z39.50 admin setup / z3950servers.pl" to C4::Breeding

z3950servers.pl is a horrible mess of hard SQL in the perl script/Controller-layer.
Also a lack of proper internal API for mutating Z3950servers makes writing tests much harder.

This patch refactors z3950servers.pl by moving SQL to C4::Breeding under proper accessors.
Comment 2 Marcel de Rooy 2016-02-22 10:56:50 UTC
sub castCGIToZ3950serverParams {
+    my ($cgi) = @_;
+
+    my $params = {};
+    $params->{'host'} =        $input->param('host'),

Sure this is what you mean? :)
cgi..inpuy
Comment 3 Marcel de Rooy 2016-02-22 10:57:07 UTC
horrible mess :)
Comment 4 Katrin Fischer 2023-08-28 21:25:09 UTC
Should now be written using objects in the Koha namespace instead of moving code into C4. Closing WONTFIX for now. I think a new bug would be better if this is tackled again according to current coding practice.