[Bug 12721] New: Wrong fieldnames or trailing | in system preference StatisticsFields lead to crash
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 Bug ID: 12721 Summary: Wrong fieldnames or trailing | in system preference StatisticsFields lead to crash Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: veron@veron.ch QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com To reproduce: 1) Edit system preference StatisticFields Set it to: location|itype|ccode Search a patron and display statistics Result: OK, statistics displas 2) Add a trailing | to StatisticFields: location|itype|ccode| Display statistics Result: Software error: Can't use an undefined value as an ARRAY reference at /usr/lib/perl5/DBI.pm line 2054. Display statistics 3) Put a space between ccode and trailing | location|itype|ccode | Display statistics Result: Statistic displays default table with Shelving locaton, Item type and Collection code 4) Remove trailing | and misspell one field: lcation|itype|ccode Display statistics Result: Software error: Can't use an undefined value as an ARRAY reference at /usr/lib/perl5/DBI.pm line 2054. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P4 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 --- Comment #1 from Marc Véron <veron@veron.ch> --- Still valid in current master 3.19.00.000 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |veron@veron.ch |ity.org | Summary|Wrong fieldnames or |Fix crash if incorrect |trailing | in system |fieldnames given in sypref |preference StatisticsFields |StatisticsFields |lead to crash | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Fix crash if incorrect |Prevent software error if |fieldnames given in sypref |incorrect fieldnames given |StatisticsFields |in sypref StatisticsFields -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 --- Comment #2 from Marc Véron <veron@veron.ch> --- Created attachment 43573 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43573&action=edit Bug 12721 - Prevent software error if incorrect fieldnames given in sypref StatisticsFields To reproduce issue: See comment #1 To test: - Apply patch - Leave syspref StatisticsFields empty - Display statistics for an author => Result: Table displays Shelving location, Collection code, Item type (as before) - Change syspref to any combination of location|itype|ccode => Result: Table displays columns as appropriate - Change syspref to some garbage => Result: Same as with empty syspref (was crashing without patch) - Change syspref to valid combination with trailing | => Result: Table displays columns as appropriate (was crashing without patch) - Change syspref to a combination of valid and invalid fields (location|blah|ccode) => Result: Table displays column of valid fields only (was crashing without patch) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 --- Comment #3 from Marc Véron <veron@veron.ch> --- Created attachment 43575 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43575&action=edit Bug 12721 - Syspref StatisticsFields: Warning on About page and text change in System preferences This patch adds a warning to the about page if the syspref 'StatisticFields' is misconfigured. Additionally, the text on Home > Administration > SystemPreferences is changed. To test: - Apply patch - Edit syspref 'StatisticFields'. Verify that the explanation makes sense. - Leave field empty => verify that no message appears on About page, tab System information - Insert valid field names, e.g. location|itype => verify that no message appears on the About page - Add trailing char => verify that the warning message appears on the About page - Fill in some garbage or misspell a field name => verify that the warning message appears on the About page -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |frederic@tamil.fr --- Comment #4 from Frédéric Demians <frederic@tamil.fr> --- Wouldn't it be better to avoid allowing entering invalid values in the first place? Using 'multiple' syspref would allow that. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 --- Comment #5 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 44316 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44316&action=edit Bug 12721 Prevent entering invalid values in StatisticsFields Using 'multiple' type for StatisticsFields syspref avoid having invalid values in, and so prevent a bug in statistics. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 --- Comment #6 from Frédéric Demians <frederic@tamil.fr> --- Marc, feel free to sign my counter patch and obsolete yours if it make sense for you, or if it doesn't, obsolete my patch. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 --- Comment #7 from Marc Véron <veron@veron.ch> --- Frédéric, Thanks for the counter patch. I considered your solution as well, but it would restrict the fields on location,itype and ccode only. But the description says: Show the following fields from the items database table as columns on the statistics tab on the patron record (...) I understand this as 'any' colums, not only location,itype and ccode -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44316|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 --- Comment #8 from Frédéric Demians <frederic@tamil.fr> ---
But the description says: Show the following fields from the items database table as columns on the statistics tab on the patron record (...)
I understand this as 'any' colums, not only location,itype and ccode
Sorry, you're correct! My patch would be a severe regression for libraries using other fields from 'items' table. What prevents me from signing your patch is that I don't like the idea of checking the existence of items field (by calling DESCRIBE items) each time the statistics fields are required. Have you explored the possibility using the column setting tool? Here: /cgi-bin/koha/admin/columns_settings.pl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 --- Comment #9 from Marc Véron <veron@veron.ch> --- Frédéric, Thanks for the hint about the column setting tool. BTW: This bug has no high for me at the moment. I'd rather like to see the C4::Dates removal finished to finally have the dd.mm.yyyy date format. There are 8 patches left to sign-off at the moment. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 --- Comment #10 from Marc Véron <veron@veron.ch> --- (In reply to Frédéric Demians from comment #8)
But the description says: Show the following fields from the items database table as columns on the statistics tab on the patron record (...)
I understand this as 'any' colums, not only location,itype and ccode
Sorry, you're correct! My patch would be a severe regression for libraries using other fields from 'items' table.
What prevents me from signing your patch is that I don't like the idea of checking the existence of items field (by calling DESCRIBE items) each time the statistics fields are required. Have you explored the possibility using the column setting tool? Here:
/cgi-bin/koha/admin/columns_settings.pl
Hi Frédéric, I have no resources at the moment to implement a solution based on columns_settings.pl Since my patch resolves a bug that leads to a software error, I propose to use it as an immediate solution and then file a new bug for the solution you propose. What do you think about? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleishaamohia@hotmail.com --- Comment #11 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Is this bug still valid? I can't see the StatisticFields syspref in version 3.23 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 --- Comment #12 from Marc Véron <veron@veron.ch> --- (In reply to Aleisha Amohia from comment #11)
Is this bug still valid? I can't see the StatisticFields syspref in version 3.23
Sorry, that was a typo in the first comment and the test plan. It is StatisticsFields -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #13 from Aleisha Amohia <aleishaamohia@hotmail.com> --- fatal: sha1 information is lacking or useless (about.pl). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 12721 - Syspref StatisticsFields: Warning on About page and text change in System preferences Setting to Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12721 --- Comment #14 from Marc Véron <veron@veron.ch> --- Hmm, it applies here... Applying: Bug 12721 - Prevent software error if incorrect fieldnames given in sypref StatisticsFields Applying: Bug 12721 - Syspref StatisticsFields: Warning on About page and text change in System preferences Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/about.tt Auto-merging about.pl -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org