[Bug 22778] New: Suggestions with no "suggester" can cause errors
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 Bug ID: 22778 Summary: Suggestions with no "suggester" can cause errors Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- If one tries to modify a suggestion that has no suggester you will get the following error: Can't call method "lang" on an undefined value at /usr/share/koha/lib/C4/Suggestions.pm line 506 Koha assumes that every suggestion has a borrowernumber in suggestedb.y -- 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=22778 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | Severity|enhancement |normal -- 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=22778 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=22778 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 88816 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=88816&action=edit Bug 22778: Suggestions with no "suggester" can cause errors If one tries to modify a suggestion that has no suggester you will get the following error: Can't call method "lang" on an undefined value at /usr/share/koha/lib/C4/Suggestions.pm line 506 Koha assumes that every suggestion has a borrowernumber in suggestedby Test Plan: 1) Create a suggestion with an unpopulated suggestedby 2) Attempt to modify that suggestion 3) Note the error 4) Apply this patch 5) Restart all teh things 6) Attempt to modify that suggestion 7) No error! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wizzyrea@gmail.com Status|Needs Signoff |Patch doesn't apply --- Comment #2 from Liz Rea <wizzyrea@gmail.com> --- Oh you are not going to like this: Using index info to reconstruct a base tree... M C4/Suggestions.pm Falling back to patching base and 3-way merge... Auto-merging C4/Suggestions.pm CONFLICT (content): Merge conflict in C4/Suggestions.pm error: Failed to merge in the changes. Terribly sorry >.< Liz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #88816|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 102229 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102229&action=edit Bug 22778: Suggestions with no "suggester" can cause errors If one tries to modify a suggestion that has no suggester you will get the following error: Can't call method "lang" on an undefined value at /usr/share/koha/lib/C4/Suggestions.pm line 506 Koha assumes that every suggestion has a borrowernumber in suggestedby Test Plan: 1) Create a suggestion with an unpopulated suggestedby 2) Attempt to modify that suggestion 3) Note the error 4) Apply this patch 5) Restart all teh things 6) Attempt to modify that suggestion 7) No error! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 David Roberts <david.roberts@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david.roberts@ptfs-europe.c | |om --- Comment #4 from David Roberts <david.roberts@ptfs-europe.com> --- I've been unable to create a suggestion without a populated suggestedby field. Even anonymous suggestions have a borrowernumber for the Anonymous patron, which I believe is correct behaviour. What is the workflow for creating a suggestion with no suggester? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Maybe try and delete the patron - I think we had a case where this caused an issue. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 David Roberts <david.roberts@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102229|0 |1 is obsolete| | --- Comment #6 from David Roberts <david.roberts@ptfs-europe.com> --- Created attachment 102426 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102426&action=edit Bug 22778: Suggestions with no "suggester" can cause errors If one tries to modify a suggestion that has no suggester you will get the following error: Can't call method "lang" on an undefined value at /usr/share/koha/lib/C4/Suggestions.pm line 506 Koha assumes that every suggestion has a borrowernumber in suggestedby Test Plan: 1) Create a suggestion with an unpopulated suggestedby 2) Attempt to modify that suggestion 3) Note the error 4) Apply this patch 5) Restart all teh things 6) Attempt to modify that suggestion 7) No error! Signed-off-by: David Roberts <david@koha-ptfs.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 David Roberts <david.roberts@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #7 from David Roberts <david.roberts@ptfs-europe.com> --- (In reply to Katrin Fischer from comment #5)
Maybe try and delete the patron - I think we had a case where this caused an issue.
Thanks, yes that worked so I've signed it off. I can't help feeling however that it would be better if we prevented any users from being deleted if they had suggestions attached. This seems like an ingenious solution to a problem that should never have been allowed to happen in the first place! :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to David Roberts from comment #7)
(In reply to Katrin Fischer from comment #5)
Maybe try and delete the patron - I think we had a case where this caused an issue.
Thanks, yes that worked so I've signed it off. I can't help feeling however that it would be better if we prevented any users from being deleted if they had suggestions attached. This seems like an ingenious solution to a problem that should never have been allowed to happen in the first place! :-)
We could add a warning maybe, but I think it's not quite possible to prevent - there might be suggestions that have already been purchased/finished and the library might still want to report on them. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Can you provide tests please? What about doing that instead: - if ( $suggestion->{STATUS} ) { + if ( $suggestion->{STATUS} && $suggestion_object->suggestedby ) { That will let us hit the expected "return 1" at the end of the subroutine. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102426|0 |1 is obsolete| | --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 102581 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102581&action=edit Bug 22778: Suggestions with no "suggester" can cause errors If one tries to modify a suggestion that has no suggester you will get the following error: Can't call method "lang" on an undefined value at /usr/share/koha/lib/C4/Suggestions.pm line 506 Koha assumes that every suggestion has a borrowernumber in suggestedby Test Plan: 1) Create a suggestion with an unpopulated suggestedby 2) Attempt to modify that suggestion 3) Note the error 4) Apply this patch 5) Restart all teh things 6) Attempt to modify that suggestion 7) No error! Signed-off-by: David Roberts <david@koha-ptfs.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 102582 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102582&action=edit Bug 22778: Add unit test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=22778 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102581|0 |1 is obsolete| | Attachment #102582|0 |1 is obsolete| | --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 102611 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102611&action=edit Bug 22778: Suggestions with no "suggester" can cause errors If one tries to modify a suggestion that has no suggester you will get the following error: Can't call method "lang" on an undefined value at /usr/share/koha/lib/C4/Suggestions.pm line 506 Koha assumes that every suggestion has a borrowernumber in suggestedby Test Plan: 1) Create a suggestion with an unpopulated suggestedby 2) Attempt to modify that suggestion 3) Note the error 4) Apply this patch 5) Restart all teh things 6) Attempt to modify that suggestion 7) No error! Signed-off-by: David Roberts <david@koha-ptfs.co.uk> 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=22778 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 102612 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102612&action=edit Bug 22778: Add unit test Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Amended patch: replace "suggestor" with "suggester" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.05.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=22778 --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|20.05.00 |20.05.00, 19.11.06 released in| | CC| |joy@bywatersolutions.com --- Comment #15 from Joy Nelson <joy@bywatersolutions.com> --- backported to 19.11.x for 19.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22778 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.05.00, 19.11.06 |20.05.00, 19.11.06, released in| |19.05.11 CC| |lucas@bywatersolutions.com Status|Pushed to stable |Pushed to oldstable --- Comment #16 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 19.05.x for 19.05.11 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org