[Bug 14428] New: use dbh directly, not C4::Context->prepare
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 Bug ID: 14428 Summary: use dbh directly, not C4::Context->prepare Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: mtompset@hotmail.com QA Contact: testopia@bugs.koha-community.org C4/Input.pm was tweaked to not use dbh directly. This gives us something kind of ugly autoload mess. Fix it. It is a partial revert of 'git show a1fe32d2'. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=9006 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|gmcharlt@gmail.com |mtompset@hotmail.com Severity|enhancement |minor -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|use dbh directly, not |Remove C4::Input |C4::Context->prepare | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 --- Comment #1 from M. Tompsett <mtompset@hotmail.com> --- After discussing on mailing list a little, and with no objections, it seems that C4/Input.pm is beyond its useful days. This bug has been repurposed to remove it, rather than correct the C4::Context->prepare autoload mess. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- mtompset@debian:~/kohaclone$ git reset --hard origin/master HEAD is now at 6e9086f Bug 3206: (QA followup) missing comma on sysprefs.sql mtompset@debian:~/kohaclone$ git grep C4::Input C4/Input.pm:package C4::Input; #assumes C4/Input C4/Input.pm:C4::Input - Miscellaneous sanity checks C4/Input.pm: use C4::Input; acqui/addorderiso2709.pl:use C4::Input; acqui/basketgroup.pl:use C4::Input; acqui/neworderempty.pl:use C4::Input; acqui/neworderempty.pl:use C4::Input; acqui/neworderempty.pl:use C4::Input; acqui/uncertainprice.pl:use C4::Input; admin/aqplan.pl:use C4::Input; members/memberentry.pl:use C4::Input; t/Input.t: use_ok('C4::Input'); mtompset@debian:~/kohaclone$ grep sub C4/Input.pm sub checkdigit ($;$) { my $temp2 = substr($infl,$i,1); if ($rem eq substr($infl,8,1)) { } # sub checkdigit mtompset@debian:~/kohaclone$ grep checkdigit `find acqui -type f` mtompset@debian:~/kohaclone$ grep checkdigit `find admin -type f` mtompset@debian:~/kohaclone$ grep checkdigit `find members -type f` mtompset@debian:~/kohaclone$ cat t/Input.t #!/usr/bin/perl # # This Koha test module is a stub! # Add more tests here!!! use strict; use warnings; use Test::More tests => 1; BEGIN { use_ok('C4::Input'); } -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 --- Comment #3 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 40906 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40906&action=edit Bug 14428: Remove C4::Input Jonathan Druart agreed that C4::Input is vestigial code that should be removed. Here is how I checked. First I found where C4::Input was used. Then, I checked what functions are in the package: just checkdigit. Then, I confirmed that checkdigit is not used at all in any acquisition, administration, or member related perl scripts. Lastly, I took a look at our supposed test file for the package. It was painfully sparse. As such, this patch removes the test file and the package file, and removes C4::Input references from these six files: - acqui/addorderiso2709.pl - acqui/basketgroup.pl - acqui/neworderempty.pl - acqui/uncertainprice.pl - admin/aqplan.pl - members/memberentry.pl NOTE: neworderempty had 3 lines of it?! Didn't anyone see that?! Here is the output of what I did to confirm this correction: mtompset@debian:~/kohaclone$ git reset --hard origin/master HEAD is now at 6e9086f Bug 3206: (QA followup) missing comma on sysprefs.sql mtompset@debian:~/kohaclone$ git grep C4::Input C4/Input.pm:package C4::Input; #assumes C4/Input C4/Input.pm:C4::Input - Miscellaneous sanity checks C4/Input.pm: use C4::Input; acqui/addorderiso2709.pl:use C4::Input; acqui/basketgroup.pl:use C4::Input; acqui/neworderempty.pl:use C4::Input; acqui/neworderempty.pl:use C4::Input; acqui/neworderempty.pl:use C4::Input; acqui/uncertainprice.pl:use C4::Input; admin/aqplan.pl:use C4::Input; members/memberentry.pl:use C4::Input; t/Input.t: use_ok('C4::Input'); mtompset@debian:~/kohaclone$ grep sub C4/Input.pm sub checkdigit ($;$) { my $temp2 = substr($infl,$i,1); if ($rem eq substr($infl,8,1)) { } # sub checkdigit mtompset@debian:~/kohaclone$ grep checkdigit `find acqui -type f` mtompset@debian:~/kohaclone$ grep checkdigit `find admin -type f` mtompset@debian:~/kohaclone$ grep checkdigit `find members -type f` mtompset@debian:~/kohaclone$ cat t/Input.t use strict; use warnings; use Test::More tests => 1; BEGIN { use_ok('C4::Input'); } Apply this patch, and the output of git grep C4::Input will be empty. Run koha qa test tools (kind of overkill) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |9006 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9006 [Bug 9006] autoload in C4::Context is a bad idea -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40906|0 |1 is obsolete| | --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 40907 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40907&action=edit Bug 14428: Remove C4::Input Jonathan Druart agreed that C4::Input is vestigial code that should be removed. Here is how I checked. First I found where C4::Input was used. Then, I checked what functions are in the package: just checkdigit. Then, I confirmed that checkdigit is not used at all in any acquisition, administration, or member related perl scripts. Lastly, I took a look at our supposed test file for the package. It was painfully sparse. As such, this patch removes the test file and the package file, and removes C4::Input references from these six files: - acqui/addorderiso2709.pl - acqui/basketgroup.pl - acqui/neworderempty.pl - acqui/uncertainprice.pl - admin/aqplan.pl - members/memberentry.pl NOTE: neworderempty had 3 lines of it?! Didn't anyone see that?! Here is the output of what I did to confirm this correction: mtompset@debian:~/kohaclone$ git reset --hard origin/master HEAD is now at 6e9086f Bug 3206: (QA followup) missing comma on sysprefs.sql mtompset@debian:~/kohaclone$ git grep C4::Input C4/Input.pm:package C4::Input; #assumes C4/Input C4/Input.pm:C4::Input - Miscellaneous sanity checks C4/Input.pm: use C4::Input; acqui/addorderiso2709.pl:use C4::Input; acqui/basketgroup.pl:use C4::Input; acqui/neworderempty.pl:use C4::Input; acqui/neworderempty.pl:use C4::Input; acqui/neworderempty.pl:use C4::Input; acqui/uncertainprice.pl:use C4::Input; admin/aqplan.pl:use C4::Input; members/memberentry.pl:use C4::Input; t/Input.t: use_ok('C4::Input'); mtompset@debian:~/kohaclone$ grep sub C4/Input.pm sub checkdigit ($;$) { my $temp2 = substr($infl,$i,1); if ($rem eq substr($infl,8,1)) { } # sub checkdigit mtompset@debian:~/kohaclone$ grep checkdigit `find acqui -type f` mtompset@debian:~/kohaclone$ grep checkdigit `find admin -type f` mtompset@debian:~/kohaclone$ grep checkdigit `find members -type f` mtompset@debian:~/kohaclone$ cat t/Input.t use strict; use warnings; use Test::More tests => 1; BEGIN { use_ok('C4::Input'); } Apply this patch, and the output of git grep C4::Input will be empty. Run koha qa test tools (kind of overkill) Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40907|0 |1 is obsolete| | --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 40913 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40913&action=edit Bug 14428: Remove C4::Input Jonathan Druart agreed that C4::Input is vestigial code that should be removed. Here is how I checked. First I found where C4::Input was used. Then, I checked what functions are in the package: just checkdigit. Then, I confirmed that checkdigit is not used at all in any acquisition, administration, or member related perl scripts. Lastly, I took a look at our supposed test file for the package. It was painfully sparse. As such, this patch removes the test file and the package file, and removes C4::Input references from these six files: - acqui/addorderiso2709.pl - acqui/basketgroup.pl - acqui/neworderempty.pl - acqui/uncertainprice.pl - admin/aqplan.pl - members/memberentry.pl NOTE: neworderempty had 3 lines of it?! Didn't anyone see that?! Here is the output of what I did to confirm this correction: mtompset@debian:~/kohaclone$ git reset --hard origin/master HEAD is now at 6e9086f Bug 3206: (QA followup) missing comma on sysprefs.sql mtompset@debian:~/kohaclone$ git grep C4::Input C4/Input.pm:package C4::Input; #assumes C4/Input C4/Input.pm:C4::Input - Miscellaneous sanity checks C4/Input.pm: use C4::Input; acqui/addorderiso2709.pl:use C4::Input; acqui/basketgroup.pl:use C4::Input; acqui/neworderempty.pl:use C4::Input; acqui/neworderempty.pl:use C4::Input; acqui/neworderempty.pl:use C4::Input; acqui/uncertainprice.pl:use C4::Input; admin/aqplan.pl:use C4::Input; members/memberentry.pl:use C4::Input; t/Input.t: use_ok('C4::Input'); mtompset@debian:~/kohaclone$ grep sub C4/Input.pm sub checkdigit ($;$) { my $temp2 = substr($infl,$i,1); if ($rem eq substr($infl,8,1)) { } # sub checkdigit mtompset@debian:~/kohaclone$ grep checkdigit `find acqui -type f` mtompset@debian:~/kohaclone$ grep checkdigit `find admin -type f` mtompset@debian:~/kohaclone$ grep checkdigit `find members -type f` mtompset@debian:~/kohaclone$ cat t/Input.t use strict; use warnings; use Test::More tests => 1; BEGIN { use_ok('C4::Input'); } Apply this patch, and the output of git grep C4::Input will be empty. Run koha qa test tools (kind of overkill) Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Checked enabling the pref checkdigit. This triggers code in C4::Members:fixup_cardnumber that apparently replaced the stuff in C4::Input at some point in time.. Still works :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14428 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Mark! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org