[Bug 41648] New: KitchenSink plugin breaks the plugins home page
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41648 Bug ID: 41648 Summary: KitchenSink plugin breaks the plugins home page Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart@gmail.com QA Contact: testopia@bugs.koha-community.org Install the KitchenSink plugin and you get: Template process failed: undef error - The given date (20-12-20) does not match the date format (iso) at /kohadevbox/koha/Koha/DateUtils.pm line 192. on /cgi-bin/koha/plugins/plugins-home.pl Because Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm: date_updated => "1900-01-01", -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41648 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|KitchenSink plugin breaks |Incorrect 'update_date' |the plugins home page |breaks the plugins home | |page --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- It's not coming from the KitchenSink plugin, I had another plugin with a wrong date: "20-12-20" -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41648 Olivia Reynolds <olivia.reynolds@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |olivia.reynolds@openfifth.c |ity.org |o.uk Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff Comma delimited| |Open Fifth list of Sponsors| | Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41648 --- Comment #2 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Created attachment 202621 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202621&action=edit Bug 41648: Handle parse errors in KohaDates If dt_from_string throws an exception whilst trying to parse the input, catch it and return an empty result. Test plan: 1. Apply patch. 2. Prove t/db_dependent/Template/Plugin/KohaDates.t Sponsored-by: Open Fifth -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41648 David Nind <david@davidnind.com> 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=41648 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #202621|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41648 --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 202657 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202657&action=edit Bug 41648: Handle parse errors in KohaDates If dt_from_string throws an exception whilst trying to parse the input, catch it and return an empty result. Test plan: 1. Apply patch. 2. Prove t/db_dependent/Template/Plugin/KohaDates.t Sponsored-by: Open Fifth Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41648 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- + my $dt = eval { dt_from_string( $text, 'iso' ) }; + return "" if $@; You are hiding an error, that could be a coding issue, or data issue. I don't think it's a good idea. You are fixing this plugin-related problem to a too low level, a better place IMO would be in Koha::Plugins (and keep a warn). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41648 --- Comment #5 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Thanks for the QA. I'd observed that templates tended to be tolerant of errors and was trying to mirror that. I'll work on bringing the validation into the Plugin model. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41648 Olivia Reynolds <olivia.reynolds@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff Patch complexity|Trivial patch |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41648 --- Comment #6 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Created attachment 202732 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202732&action=edit Bug 41648: Validate plugin date metadata If a plugin reports a date_authored or date_updated we can't parse, remove the invalid property from the metadata hashref and emit a warning. To test this, introduce a separate test plugin directory and test file. Having a plugin that produces warnings in the main test directory would require accounting for this warning in every existing test that loads plugins. Correspondingly, this patch also fixes an invalid date in an existing test plugin. Test plan: 1. Apply patch. 2. Run `prove -r t/db_dependent/Koha/Plugins/` and verify there are no test failures. Sponsored-by: Open Fifth -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41648 David Nind <david@davidnind.com> 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=41648 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #202657|0 |1 is obsolete| | Attachment #202732|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41648 --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 202963 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202963&action=edit Bug 41648: Handle parse errors in KohaDates If dt_from_string throws an exception whilst trying to parse the input, catch it and return an empty result. Test plan: 1. Apply patch. 2. Prove t/db_dependent/Template/Plugin/KohaDates.t Sponsored-by: Open Fifth Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41648 --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 202964 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202964&action=edit Bug 41648: Validate plugin date metadata If a plugin reports a date_authored or date_updated we can't parse, remove the invalid property from the metadata hashref and emit a warning. To test this, introduce a separate test plugin directory and test file. Having a plugin that produces warnings in the main test directory would require accounting for this warning in every existing test that loads plugins. Correspondingly, this patch also fixes an invalid date in an existing test plugin. Test plan: 1. Apply patch. 2. Run `prove -r t/db_dependent/Koha/Plugins/` and verify there are no test failures. Sponsored-by: Open Fifth Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41648 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #9 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. Tests pass before and after the patches. 2. I wasn't able to reproduce the error with the kitchen sink plugin (v 2.7.1) (no error when I uploaded either in the staff interface or logs). -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org