[Bug 6877] New: test for Libravatar::URL can cause scripts to abort
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6877 Bug #: 6877 Summary: test for Libravatar::URL can cause scripts to abort Classification: Unclassified Change sponsored?: --- Product: Koha Version: unspecified Platform: All OS/Version: All Status: NEW Severity: normal Priority: P5 Component: OPAC AssignedTo: oleonard@myacpl.org ReportedBy: colin.campbell@ptfs-europe.com QAContact: koha-bugs@lists.koha-community.org Scripts attempt to do a runtime conditional import of the Libravatar::URL but uses 'use' rather than require/import so that this is done at compile time and the script will abort on compile and not process the code before the eval. Change the code to use require that is executed at runtime and an eval block rather than a string eval. Personally using eval for this is a bit of a code smell. Checking the existence of the module on every run seems inefficient. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6877 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 |PATCH-Sent Patch Status|--- |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6877 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|oleonard@myacpl.org |colin.campbell@ptfs-europe. | |com --- Comment #1 from Colin Campbell <colin.campbell@ptfs-europe.com> 2011-09-17 12:15:15 UTC --- Created attachment 5450 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5450 Proposed patch -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6877 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz --- Comment #2 from Chris Cormack <chris@bigballofwax.co.nz> 2011-09-19 09:35:10 UTC --- Can you think of a nicer way to do it Colin? We could shift it inside the if, so its only checked if they have the syspref on? If you don't mind I can change your patch to do that, as well as changing the use to a require -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6877 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #5450|0 |1 is obsolete| | --- Comment #3 from Colin Campbell <colin.campbell@ptfs-europe.com> 2011-09-23 16:05:32 UTC --- Created attachment 5568 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5568 Updated patch -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6877 --- Comment #4 from Colin Campbell <colin.campbell@ptfs-europe.com> 2011-09-23 16:10:57 UTC --- Updated patch to embed eval within check of syspreference. Makes for more readable code. There is a CPAN module for conditional inclusion of modules but I've not actually used it. Having a wrapper for that functionality might be useful to make calls more consistent and keep calling code readable. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6877 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #5568|0 |1 is obsolete| | --- Comment #5 from Chris Cormack <chris@bigballofwax.co.nz> 2011-10-28 20:11:27 UTC --- Created attachment 6105 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=6105 Bug 6877 - use is executed and errors at compile time Although use is being called in an eval it will still be executed at compile time so that an error can cause the script to abort before the eval is executed. The eval expression syntax is not checked so eval block should be preferred. Use require/import which execute at runtime which is the intention here. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6877 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |rel_3_6 Patch Status|Needs Signoff |Signed Off -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6877 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Version|rel_3_6 |master Patch Status|Signed Off |Passed QA QAContact|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | --- Comment #6 from M. de Rooy <m.de.rooy@rijksmuseum.nl> 2011-11-24 11:42:38 UTC --- QA Comment: This patch already improves the current code. Ideas to do it even better (referring to above comments) are welcome of course. Marking it as Passed QA. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6877 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.poulain@biblibre.com Version|master |rel_3_6 Patch Status|Passed QA |Patch Pushed --- Comment #7 from Paul Poulain <paul.poulain@biblibre.com> 2011-11-25 13:20:50 UTC --- patch pushed, please test QA comment: what can cause a problem ? I just see the case where the library is not installed & the feature disabled. Is there something else ? -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6877 --- Comment #8 from Colin Campbell <colin.campbell@ptfs-europe.com> 2011-11-25 14:58:48 UTC --- Re Paul's comment - the script aborts i.e. more than the tested feature gets disabled -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6877 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #9 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This was included in the 3.6 branch prior to 3.6.4. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org