[Bug 19080] New: Handle non existing patrons
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 Bug ID: 19080 Summary: Handle non existing patrons Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: major Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org If a patron does not exist, scripts from the members module should handle it gracefully instead of crashing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 65834 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65834&action=edit Bug 19080: Handle non-existing patrons gratefully This is a recurrent bug we have over the last years. When a script is called with non-existent borrowernumber it will crashes. We need to handle this gracefully instead of letting the script crashes. On bug 18403 a new subroutine is added to the codebase (output_and_exit_if_error) to handle this kind of errors correctly. Since it is not pushed yet, I propose to just redirect to a script that handle it correctly (circulation.pl) instead of adding this message to all these scripts. Test plan: Hit different scripts from the members module and pass a non-existent borrowernumber. You must be redirected to circulation.pl with a friendly message. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #65834|0 |1 is obsolete| | --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 65854 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65854&action=edit Bug 19080: Handle non-existing patrons gratefully This is a recurrent bug we have over the last years. When a script is called with non-existent borrowernumber it will crashes. We need to handle this gracefully instead of letting the script crashes. On bug 18403 a new subroutine is added to the codebase (output_and_exit_if_error) to handle this kind of errors correctly. Since it is not pushed yet, I propose to just redirect to a script that handle it correctly (circulation.pl) instead of adding this message to all these scripts. Test plan: Hit different scripts from the members module and pass a non-existent borrowernumber. You must be redirected to circulation.pl with a friendly message. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #3 from Owen Leonard <oleonard@myacpl.org> --- I had problems with several of the modified scripts: members/deletemem.pl - Loads the logged-in patron's account into circulation instead of showing the message. members/member-flags.pl & members/member-password.pl - Load circ with empty borrowernumber parameter and no message members/memberentry.pl - Loads "modify patron" form with no data. No redirect. members/update-child.pl - "An Error Occurred" 500 Internal Server Error -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 66036 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66036&action=edit Bug 19080: Fix member vs borrowernumber in delmember -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Owen Leonard from comment #3)
I had problems with several of the modified scripts:
members/deletemem.pl - Loads the logged-in patron's account into circulation instead of showing the message.
Indeed, wrong variable. Fixed!
members/member-flags.pl & members/member-password.pl - Load circ with empty borrowernumber parameter and no message
members/memberentry.pl - Loads "modify patron" form with no data. No redirect.
members/update-child.pl - "An Error Occurred" 500 Internal Server Error
I think you got that because called these scripts only with the borrowernumber parameter. Most of them need a "op" variable to behave correctly. I guess you get the same behaviour with an existing borrowernumber. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 Josef Moravec <josef.moravec@gmail.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=19080 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #65854|0 |1 is obsolete| | Attachment #66036|0 |1 is obsolete| | --- Comment #6 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 66190 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66190&action=edit [SIGNED-OFF] Bug 19080: Handle non-existing patrons gratefully This is a recurrent bug we have over the last years. When a script is called with non-existent borrowernumber it will crashes. We need to handle this gracefully instead of letting the script crashes. On bug 18403 a new subroutine is added to the codebase (output_and_exit_if_error) to handle this kind of errors correctly. Since it is not pushed yet, I propose to just redirect to a script that handle it correctly (circulation.pl) instead of adding this message to all these scripts. Test plan: Hit different scripts from the members module and pass a non-existent borrowernumber. You must be redirected to circulation.pl with a friendly message. Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 --- Comment #7 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 66191 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66191&action=edit [SIGNED-OFF] Bug 19080: Fix member vs borrowernumber in delmember Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |julian.maurice@biblibre.com --- Comment #8 from Julian Maurice <julian.maurice@biblibre.com> --- QA comment: 1) $ perlcritic members/routing-lists.pl Variable declared in conditional statement at line 51, column 1. Declare variables outside of the condition. (Severity: 5) This error is not detected by koha-qa, I'm not sure why. 2) If borrowernumber is 0, empty or not defined, the error message is not displayed in circ/circulation.pl Failing QA for 1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 66383 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66383&action=edit Bug 19080: Fix perlcritic in routing-lists.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Julian Maurice from comment #8)
QA comment:
1) $ perlcritic members/routing-lists.pl Variable declared in conditional statement at line 51, column 1. Declare variables outside of the condition. (Severity: 5)
This error is not detected by koha-qa, I'm not sure why.
Fixed, thanks! (not sure koha-qa does not catch it)
2) If borrowernumber is 0, empty or not defined, the error message is not displayed in circ/circulation.pl
Yes it's the existing behaviour, I do not think we should change it here (if we really want to change it) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=19080 --- Comment #11 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 66384 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66384&action=edit Bug 19080: Handle non-existing patrons gratefully This is a recurrent bug we have over the last years. When a script is called with non-existent borrowernumber it will crashes. We need to handle this gracefully instead of letting the script crashes. On bug 18403 a new subroutine is added to the codebase (output_and_exit_if_error) to handle this kind of errors correctly. Since it is not pushed yet, I propose to just redirect to a script that handle it correctly (circulation.pl) instead of adding this message to all these scripts. Test plan: Hit different scripts from the members module and pass a non-existent borrowernumber. You must be redirected to circulation.pl with a friendly message. Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 --- Comment #12 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 66385 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66385&action=edit Bug 19080: Fix member vs borrowernumber in delmember Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #66383|0 |1 is obsolete| | --- Comment #13 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 66386 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66386&action=edit Bug 19080: Fix perlcritic in routing-lists.pl Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 Julian Maurice <julian.maurice@biblibre.com> 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=19080 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com Attachment #66190|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=19080 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #66191|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=19080 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 17.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Depends on| |17829 CC| |fridolin.somers@biblibre.co | |m Resolution|--- |FIXED --- Comment #15 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Depends a lot on Bug 17829, I'm not backporting to 17.05.x Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17829 [Bug 17829] Move GetMember to Koha::Patron -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19080 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |19791 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19791 [Bug 19791] patron Modification log redirects to circulation page (Koha 17.11) -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org