[Bug 13522] New: tools/viewlog.pl does not compile in older perls
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13522 Bug ID: 13522 Summary: tools/viewlog.pl does not compile in older perls Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Tools Assignee: gmcharlt@gmail.com Reporter: colin.campbell@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org Attempting to view logs on a system with a perl older than 5.12 gives the following compile time error: Type of arg 1 to keys must be hash (not array element) at viewlog.pl line 214, near "];" Prior to 5.12 keys could only be called on a hash sites using 5.10 cannot use viewlog as a result -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13522 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |colin.campbell@ptfs-europe. | |com Status|NEW |Needs Signoff --- Comment #1 from Colin Campbell <colin.campbell@ptfs-europe.com> --- Created attachment 34978 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34978&action=edit Proposed patch To test. you need a perl version prior to 5.12 without the patch perl -wc tools/viewlog.pl gives the syntax error from the bug description and fails to compile wit the patch applied it should compile correctly -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13522 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- *** Bug 13538 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13522 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |11331 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13522 Jonathan Druart <jonathan.druart@biblibre.com> 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=13522 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #34978|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 35034 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35034&action=edit Bug 13522: Make it explicit that scalar containd a hash ref Prior to perl 5.12 keys can only operate on a hash. So although $data[0] ( thats an abysmal variable name! ) will contain a hash ref the perl compiler cannot deduce that from the context and gives a syntax error. Add the hash sigil to make the context explicit and the compiler can generate the correct code. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13522 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|minor |major Patch complexity|--- |Trivial patch --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- I had exactly the same patch. I consider this as major since the page is not accessible at all. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13522 --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- I tested it on a sandbox (perl 5.10.1). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13522 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=13522 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35034|0 |1 is obsolete| | --- Comment #6 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 35041 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35041&action=edit [PASSED QA] Bug 13522: Make it explicit that scalar containd a hash ref Prior to perl 5.12 keys can only operate on a hash. So although $data[0] ( thats an abysmal variable name! ) will contain a hash ref the perl compiler cannot deduce that from the context and gives a syntax error. Add the hash sigil to make the context explicit and the compiler can generate the correct code. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13522 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolyn.somers@biblibre.co | |m --- Comment #7 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Sorry for this bug. In the same context, have a look at admin/auth_subfields_structure.pl, Line 102 : my @authtypes = (sort keys getauthtypes); getauthtypes return a harsh ref, not a hash. Is it also a dangerous code ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13522 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13544 --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Fridolin SOMERS from comment #7)
Sorry for this bug.
In the same context, have a look at admin/auth_subfields_structure.pl, Line 102 : my @authtypes = (sort keys getauthtypes); getauthtypes return a harsh ref, not a hash. Is it also a dangerous code ?
Good catch, I have opened bug 13544. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13522 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|Passed QA |Pushed to Master --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Colin! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13522 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #10 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.18.x, will be in 3.18.3 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13522 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #11 from Mason James <mtj@kohaaloha.com> --- Pushed to 3.16.x, will be in 3.16.7 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org