[Bug 42803] New: Regression in reports/catalogue_out.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42803 Bug ID: 42803 Summary: Regression in reports/catalogue_out.pl Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Reports Assignee: koha-bugs@lists.koha-community.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: lisette@bywatersolutions.com Target Milestone: ---
From Bug 42361:
1) Set strict_sql_modes to 0 in koha-conf.xml and restart plack 2) Go to Reports > Items with no checkouts: <staff_url>/cgi-bin/koha/reports/catalogue_out.pl 3) Leave Library set to "Any library" 4) Pick a specific item type that you know has items (e.g. "BK") 5) Submit, you get 0 results. Without patch you get normal results. If the first filter value is empty (i.e. 'Any library'), the filter key gets skipped which essentially results in items.homebranch LIKE 'BK' (from the test plan above). I think we need this: foreach my $filter (@filters_input) { - if ( Koha::Libraries->find($filter) || Koha::ItemTypes->find($filter) ) { + if ( !$filter || Koha::Libraries->find($filter) || Koha::ItemTypes->find($filter) ) { push( @filters, $filter ); } } -- 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=42803 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |42361 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42361 [Bug 42361] SQL Injection in reports/catalogue_out.pl via Filter parameter (error-based, triggered when Criteria matches /branchcode/) -- 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=42803 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@openfifth.co.u | |k -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42803 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au, | |jonathan.druart@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42803 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Ah yep, I see. I'll take a look. -- 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=42803 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- 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=42803 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- Created attachment 200698 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200698&action=edit Bug 42803: Fix case where filter is not supplied This change fixes the case where "Any library" and "Any item type" weren't validating. Test plan: 0) Apply the patch 1) Set strict_sql_modes to 0 in koha-conf.xml and restart plack 2) Go to Reports > Items with no checkouts: <staff_url>/cgi-bin/koha/reports/catalogue_out.pl 3) Leave Library set to "Any library" 4) Pick a specific item type that you know has items (e.g. "BK") 5) Note that you get results -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42803 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Good catch, Lucas. Sorry about that! Overzealous with my filtering. I ran into the same problem yesterday with bug 42870 😅 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42803 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=42803 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200698|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=42803 --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 200701 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200701&action=edit Bug 42803: Fix case where filter is not supplied This change fixes the case where "Any library" and "Any item type" weren't validating. Test plan: 0) Apply the patch 1) Set strict_sql_modes to 0 in koha-conf.xml and restart plack 2) Go to Reports > Items with no checkouts: <staff_url>/cgi-bin/koha/reports/catalogue_out.pl 3) Leave Library set to "Any library" 4) Pick a specific item type that you know has items (e.g. "BK") 5) Note that you get results 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=42803 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Regression in |Regression in Reports > |reports/catalogue_out.pl |Items with no checkouts | |(reports/catalogue_out.pl) CC| |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=42803 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA QA Contact|testopia@bugs.koha-communit |jonathan.druart@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42803 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200701|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=42803 --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 200702 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200702&action=edit Bug 42803: Fix case where filter is not supplied This change fixes the case where "Any library" and "Any item type" weren't validating. Test plan: 0) Apply the patch 1) Set strict_sql_modes to 0 in koha-conf.xml and restart plack 2) Go to Reports > Items with no checkouts: <staff_url>/cgi-bin/koha/reports/catalogue_out.pl 3) Leave Library set to "Any library" 4) Pick a specific item type that you know has items (e.g. "BK") 5) Note that you get results Signed-off-by: David Nind <david@davidnind.com> 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=42803 --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 200703 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200703&action=edit Bug 42803: Only perform the lookups when !$filter is true 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=42803 --- Comment #7 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 200704 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200704&action=edit Bug 42803: Add a Cypress test 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=42803 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #8 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- (In reply to Jonathan Druart from comment #7)
Created attachment 200704 [details] [review] Bug 42803: Add a Cypress test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
I think this cypress test will require: <strict_sql_modes>0</strict_sql_modes> Correct? Otherwise it will fail with a 500 error code. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42803 --- Comment #9 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Pedro Amorim (ammopt) from comment #8)
(In reply to Jonathan Druart from comment #7)
Created attachment 200704 [details] [review] [review] Bug 42803: Add a Cypress test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
I think this cypress test will require: <strict_sql_modes>0</strict_sql_modes>
Correct? Otherwise it will fail with a 500 error code.
Indeed! There is no way to mock the config, I will obsolete the patch :-( -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42803 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200704|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=42803 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42803 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42803 --- Comment #10 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org