[Bug 42844] New: Subscription search breaks when using additional field and no search result is returned
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42844 Bug ID: 42844 Summary: Subscription search breaks when using additional field and no search result is returned Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Serials Assignee: koha-bugs@lists.koha-community.org Reporter: bibliothek@th-wildau.de QA Contact: testopia@bugs.koha-community.org Target Milestone: --- Using addition fields in subscriptions can break the subscription search (serials-search.pl) when searching for an additional field but no record matching this field. To create: - create an additional field for subscriptions: More -> Serials -> Manage subscription fields. F.e. use an authorized value country. - Make sure "searchable" is checked. - go to More -> Serials - With bug 40201 pushed you can enter that additional field on serials-home - Otherwise just perform an empty search and on serials-search.pl choose the additional field as search criteria - Click search - An Error trace for Can't use an undefined value as an ARRAY reference will be displayed -- 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=42844 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |bibliothek@th-wildau.de |ity.org | -- 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=42844 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42844 --- Comment #1 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 200394 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200394&action=edit Bug 42844: Fix broken subscription search when using additional fields as seach criteria This fixes an error when searching for a subscription with an additional field when no result is found by changing the call of SearchSubscriptions to expect an array instead of an hash ref. Serials.pm, when using filter_by_additional_fields may return an empty array, but the calling function only checked for an hash ref which lead to an error when no result was found. Testplan: a) create an additional field for subscriptions: More -> Serials -> Manage subscription fields f.e. use an AV CCODE as additional field make sure "searchable" is checked No subscription should use this additional field by now. b) go to More -> Serials c1) if bug 40201 is pushed you can search for that additional field on serials-home -> An error stack trace will appear. c2) otherwise perform an empty search on serials home to end on serials-search. In the search form on the left select that additional field as search criteria. -> An error stack trace will appear. d) add a subscription using that additional field -> More -> Serials -> New subscription. On step two there is a section for Additional fields. Select f.e. CCODE Fiction e) redo c1 or c2 using that additonal field value as search criteria. f) Check that the search result shows your subscription. g) apply patch and redo c1 or c2 for an additional field value that is not used (f.e. Non-fiction) h) The search should work now, returning 0 results instead of an error i) check that searching for a used additional field (f.e. Fiction) still works -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42844 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=40201 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42844 OpenFifth Sandboxes <sandboxes@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200394|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=42844 --- Comment #2 from OpenFifth Sandboxes <sandboxes@openfifth.co.uk> --- Created attachment 200436 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200436&action=edit Bug 42844: Fix broken subscription search when using additional fields as seach criteria This fixes an error when searching for a subscription with an additional field when no result is found by changing the call of SearchSubscriptions to expect an array instead of an hash ref. Serials.pm, when using filter_by_additional_fields may return an empty array, but the calling function only checked for an hash ref which lead to an error when no result was found. Testplan: a) create an additional field for subscriptions: More -> Serials -> Manage subscription fields f.e. use an AV CCODE as additional field make sure "searchable" is checked No subscription should use this additional field by now. b) go to More -> Serials c1) if bug 40201 is pushed you can search for that additional field on serials-home -> An error stack trace will appear. c2) otherwise perform an empty search on serials home to end on serials-search. In the search form on the left select that additional field as search criteria. -> An error stack trace will appear. d) add a subscription using that additional field -> More -> Serials -> New subscription. On step two there is a section for Additional fields. Select f.e. CCODE Fiction e) redo c1 or c2 using that additonal field value as search criteria. f) Check that the search result shows your subscription. g) apply patch and redo c1 or c2 for an additional field value that is not used (f.e. Non-fiction) h) The search should work now, returning 0 results instead of an error i) check that searching for a used additional field (f.e. Fiction) still works Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42844 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michaela.sieber@kit.edu 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=42844 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com, | |katrin.fischer@bsz-bw.de, | |martin.renvoize@openfifth.c | |o.uk Severity|minor |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42844 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |jonathan.druart@gmail.com |y.org | Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42844 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200436|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=42844 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 200448 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200448&action=edit Bug 42844: Fix broken subscription search when using additional fields as seach criteria This fixes an error when searching for a subscription with an additional field when no result is found by changing the call of SearchSubscriptions to expect an array instead of an hash ref. Serials.pm, when using filter_by_additional_fields may return an empty array, but the calling function only checked for an hash ref which lead to an error when no result was found. Testplan: a) create an additional field for subscriptions: More -> Serials -> Manage subscription fields f.e. use an AV CCODE as additional field make sure "searchable" is checked No subscription should use this additional field by now. b) go to More -> Serials c1) if bug 40201 is pushed you can search for that additional field on serials-home -> An error stack trace will appear. c2) otherwise perform an empty search on serials home to end on serials-search. In the search form on the left select that additional field as search criteria. -> An error stack trace will appear. d) add a subscription using that additional field -> More -> Serials -> New subscription. On step two there is a section for Additional fields. Select f.e. CCODE Fiction e) redo c1 or c2 using that additonal field value as search criteria. f) Check that the search result shows your subscription. g) apply patch and redo c1 or c2 for an additional field value that is not used (f.e. Non-fiction) h) The search should work now, returning 0 results instead of an error i) check that searching for a used additional field (f.e. Fiction) still works Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> 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=42844 --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- Ok but the sub is still broken (depending on wantarray the returned values is different if additional fields are passed or not). I think this was the last occurrences in the code when we don't return an array, so ideally we should have a follow-up bug to remove wantarray from this sub. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42844 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42844 --- Comment #5 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42844 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|26.11.00 |26.11.00,26.05.01 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42844 --- Comment #6 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to 26.05.x for the upcoming 26.05.01 release. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org