[Bug 16809] New: Silence authority warnings C4::Biblio::TransformHtmlToMarc
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 Bug ID: 16809 Summary: Silence authority warnings C4::Biblio::TransformHtmlToMarc Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Staff Client Assignee: mtompset@hotmail.com Reporter: mtompset@hotmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com While trying to test another bug. I was annoyed by the floody nature of TransformHtmlToMarc in C4/Biblio.pm To reproduce: 1) Back up your intranet error log -- for example: cp ~/koha-dev/var/log/koha-error-log ~/koha-error-log.backup 2) Blank your intranet error log -- for example: echo > ~/koha-dev/var/log/koha-error-log 3) Log into your staff client 4) Click 'Authorities' 5) Click 'New from Z39.50' 5) Type 'Seuss' into 'Name (any):' and press enter 6) Click 'Import' beside the first link 7) Click 'Save' 8) Check your koha-error-log -- floody! 9) Apply patch 10) repeat steps 2-8 -- blank! 11) restore your intranet error log -- for example: mv ~/koha-error-log.backup ~/koha-dev/var/log/koha-error-log 12) run koha qa test tools -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 --- Comment #1 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 52832 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=52832&action=edit Bug 16809: Silence authority warnings C4::Biblio::TransformHtmlToMarc Most of the floodiness is caused by accessing the cgi parameters in a context which is hard to determine. By purposefully saving the value to a scalar variable and using the variable, the issue disappears, and it will likely be a tiny tad faster as variable access is faster than multiple function calls. TEST PLAN --------- 1) Back up your intranet error log -- for example: cp ~/koha-dev/var/log/koha-error-log ~/koha-error-log.backup 2) Blank your intranet error log -- for example: echo > ~/koha-dev/var/log/koha-error-log 3) Log into your staff client 4) Click 'Authorities' 5) Click 'New from Z39.50' 5) Type 'Seuss' into 'Name (any):' and press enter 6) Click 'Import' beside the first link 7) Click 'Save' 8) Check your koha-error-log -- floody! 9) Apply patch 10) repeat steps 2-8 -- blank! 11) restore your intranet error log -- for example: mv ~/koha-error-log.backup ~/koha-dev/var/log/koha-error-log 12) run koha qa test tools -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=16746 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |minor -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 Liz Rea <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |In Discussion CC| |liz@catalyst.net.nz --- Comment #2 from Liz Rea <liz@catalyst.net.nz> --- Hi Mark, I was unable to replicate the flooding, but the patch doesn't seem to hurt anything. Not super into change for the sake of it, can you still replicate this on current master? Cheers, Liz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 --- Comment #3 from M. Tompsett <mtompset@hotmail.com> --- mtompset@debian:~/kohaclone$ echo > ~/koha-dev/var/log/koha-error_log mtompset@debian:~/kohaclone$ cat ~/koha-dev/var/log/koha-error_log | cut -f12- -d" " | sort -u [Sun Aug 7 10:40:24 2016] authorities.pl: CGI::param called in list context from package C4::Biblio line 2580, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436., referer: http://library-admin.debiankoha.ca/cgi-bin/koha/authorities/authorities.pl?breedingid=115&authtypecode=PERSO_NAME&authid=0 [Sun Aug 7 10:40:24 2016] authorities.pl: CGI::param called in list context from package C4::Biblio line 2588, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436., referer: http://library-admin.debiankoha.ca/cgi-bin/koha/authorities/authorities.pl?breedingid=115&authtypecode=PERSO_NAME&authid=0 [Sun Aug 7 10:40:24 2016] authorities.pl: CGI::param called in list context from package C4::Biblio line 2605, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436., referer: http://library-admin.debiankoha.ca/cgi-bin/koha/authorities/authorities.pl?breedingid=115&authtypecode=PERSO_NAME&authid=0 [Sun Aug 7 10:40:24 2016] authorities.pl: CGI::param called in list context from package C4::Biblio line 2608, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436., referer: http://library-admin.debiankoha.ca/cgi-bin/koha/authorities/authorities.pl?breedingid=115&authtypecode=PERSO_NAME&authid=0 $ uname -a Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64 GNU/Linux $ sudo apache2 -v Server version: Apache/2.4.10 (Debian) Server built: Jul 20 2016 06:48:18 Yes, Liz. I do still get it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #52832|0 |1 is obsolete| | --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 54535 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54535&action=edit Bug 16809: Silence authority warnings C4::Biblio::TransformHtmlToMarc Most of the floodiness is caused by accessing the cgi parameters in a context which is hard to determine. By purposefully saving the value to a scalar variable and using the variable, the issue disappears, and it will likely be a tiny tad faster as variable access is faster than multiple function calls. TEST PLAN --------- 1) Back up your intranet error log -- for example: cp ~/koha-dev/var/log/koha-error-log ~/koha-error-log.backup 2) Blank your intranet error log -- for example: echo > ~/koha-dev/var/log/koha-error-log 3) Log into your staff client 4) Click 'Authorities' 5) Click 'New from Z39.50' 5) Type 'Seuss' into 'Name (any):' and press enter 6) Click 'Import' beside the first link 7) Click 'Save' 8) Check your koha-error-log -- floody! 9) Apply patch 10) repeat steps 2-8 -- blank! 11) restore your intranet error log -- for example: mv ~/koha-error-log.backup ~/koha-dev/var/log/koha-error-log 12) run koha qa test tools Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested with addbiblio.pl. I would have preferred the scalar option in terms of simpler code, but this works too. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 54536 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54536&action=edit Bug 16809: Follow-up for scalarizing biblionumber Still resolves another multi_param warning. Test plan: Look at your logs before and after this patch when saving a biblio record (you may have to start plack again). If your biblionumber is mapped to 999c, you should no longer have a warn about line 2563 (disclaimer: line numbers are subject to change). Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Silence authority warnings |Silence CGI param warnings |C4::Biblio::TransformHtmlTo |from |Marc |C4::Biblio::TransformHtmlTo | |Marc CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #54535|0 |1 is obsolete| | --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 54649 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54649&action=edit Bug 16809: Silence authority warnings C4::Biblio::TransformHtmlToMarc Most of the floodiness is caused by accessing the cgi parameters in a context which is hard to determine. By purposefully saving the value to a scalar variable and using the variable, the issue disappears, and it will likely be a tiny tad faster as variable access is faster than multiple function calls. TEST PLAN --------- 1) Back up your intranet error log -- for example: cp ~/koha-dev/var/log/koha-error-log ~/koha-error-log.backup 2) Blank your intranet error log -- for example: echo > ~/koha-dev/var/log/koha-error-log 3) Log into your staff client 4) Click 'Authorities' 5) Click 'New from Z39.50' 5) Type 'Seuss' into 'Name (any):' and press enter 6) Click 'Import' beside the first link 7) Click 'Save' 8) Check your koha-error-log -- floody! 9) Apply patch 10) repeat steps 2-8 -- blank! 11) restore your intranet error log -- for example: mv ~/koha-error-log.backup ~/koha-dev/var/log/koha-error-log 12) run koha qa test tools Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested with addbiblio.pl. I would have preferred the scalar option in terms of simpler code, but this works too. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #54536|0 |1 is obsolete| | --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 54650 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54650&action=edit Bug 16809: Follow-up for scalarizing biblionumber Still resolves another multi_param warning. Test plan: Look at your logs before and after this patch when saving a biblio record (you may have to start plack again). If your biblionumber is mapped to 999c, you should no longer have a warn about line 2563 (disclaimer: line numbers are subject to change). Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |kyle@bywatersolutions.com --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 16.11, thanks Marcel, Mark! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16809 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #9 from Julian Maurice <julian.maurice@biblibre.com> --- Pushed to 3.22.x, will be in 3.22.11 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org