[Bug 21702] New: mancredit.pl incorrectly passes user_id instead of the patron id
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21702 Bug ID: 21702 Summary: mancredit.pl incorrectly passes user_id instead of the patron id Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Fines and fees Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org I think unsafe SQL modes and the fact that manager_id has no FK allowed this to go unnoticed. But now we catch it! To reproduce: - On a patron, try adding a new manual credit of any type => FAIL: It fails telling the userid of the logged user is not a valid integer! -- 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=21702 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20980 CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |martin.renvoize@ptfs-europe | |.com Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20980 [Bug 20980] Manual credit offsets are stored as debits -- 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=21702 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 81360 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81360&action=edit Bug 21702: Make mancredit.pl use the patron id for the staff user I think unsafe SQL modes and the fact that manager_id has no FK allowed this to go unnoticed. But now we catch it! To test: - On a patron, try adding a new manual credit of any type => FAIL: It fails telling the userid of the logged user is not a valid integer! - Apply this patch - Try adding a manual credit of any type => SUCCESS: Manual credit added! - Sign off! Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21702 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 81361 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81361&action=edit Bug 21702: (follow-up) Simplify checks and use standard fallback behaviour This patch acknowledges the fact that some checks here are done in a way that is not standard these days. This checks are originally done multiple times in different ways. output_and_exit_if_error should be used. This implies a minor behaviour change: if the passed (in the URL) borrowernumber doesn't exist, it sends the user to a 'Patron doesn't exist page' instead of the circulation page for the borrowernumber. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21702 Tomás Cohen Arazi <tomascohen@gmail.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=21702 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle.m.hall@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21702 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_18_11_candidate CC| |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21702 Andrew Isherwood <andrew.isherwood@ptfs-europe.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=21702 Andrew Isherwood <andrew.isherwood@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81360|0 |1 is obsolete| | --- Comment #3 from Andrew Isherwood <andrew.isherwood@ptfs-europe.com> --- Created attachment 81464 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81464&action=edit Bug 21702: Make mancredit.pl use the patron id for the staff user I think unsafe SQL modes and the fact that manager_id has no FK allowed this to go unnoticed. But now we catch it! To test: - On a patron, try adding a new manual credit of any type => FAIL: It fails telling the userid of the logged user is not a valid integer! - Apply this patch - Try adding a manual credit of any type => SUCCESS: Manual credit added! - Sign off! Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21702 Andrew Isherwood <andrew.isherwood@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81361|0 |1 is obsolete| | --- Comment #4 from Andrew Isherwood <andrew.isherwood@ptfs-europe.com> --- Created attachment 81465 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81465&action=edit Bug 21702: (follow-up) Simplify checks and use standard fallback behaviour This patch acknowledges the fact that some checks here are done in a way that is not standard these days. This checks are originally done multiple times in different ways. output_and_exit_if_error should be used. This implies a minor behaviour change: if the passed (in the URL) borrowernumber doesn't exist, it sends the user to a 'Patron doesn't exist page' instead of the circulation page for the borrowernumber. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21702 Josef Moravec <josef.moravec@gmail.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=21702 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81464|0 |1 is obsolete| | Attachment #81465|0 |1 is obsolete| | --- Comment #5 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 81593 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81593&action=edit Bug 21702: Make mancredit.pl use the patron id for the staff user I think unsafe SQL modes and the fact that manager_id has no FK allowed this to go unnoticed. But now we catch it! To test: - On a patron, try adding a new manual credit of any type => FAIL: It fails telling the userid of the logged user is not a valid integer! - Apply this patch - Try adding a manual credit of any type => SUCCESS: Manual credit added! - Sign off! Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> 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=21702 --- Comment #6 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 81594 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81594&action=edit Bug 21702: (follow-up) Simplify checks and use standard fallback behaviour This patch acknowledges the fact that some checks here are done in a way that is not standard these days. This checks are originally done multiple times in different ways. output_and_exit_if_error should be used. This implies a minor behaviour change: if the passed (in the URL) borrowernumber doesn't exist, it sends the user to a 'Patron doesn't exist page' instead of the circulation page for the borrowernumber. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> 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=21702 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com QA Contact|testopia@bugs.koha-communit |josef.moravec@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=21702 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #7 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21702 --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I'm not entirely confident in backporting this.. if it's required for 18.05.x series could you submit an alternative patch for it? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21702 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Reworked version pushed to 18.05.x series for 18.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21702 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Stable |RESOLVED CC| |fridolin.somers@biblibre.co | |m --- Comment #10 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Depends on bug 20980 not in 17.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org