[Bug 43346] New: MarkLostItemsAsReturned does not work without userenv set
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43346 Bug ID: 43346 Summary: MarkLostItemsAsReturned does not work without userenv set Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: andreas.jonsson@kreablo.se QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Target Milestone: --- If MarkLostItemsAsReturned is called when there is no userenv set it fails because "checkin_library" is set from userenv. $issue->checkin_library( C4::Context->userenv->{'branch'} ); I have developed an Opac payment plugin with a callback to a public REST endpoint, that is authenticated by a cryptographic token (similar to the easy payments plugin). This callback is executed without userenv and will therefore occasionally fail. As the item is lost, it is unclear what the checkin_library should signify. Setting it the the branchcode on the issue seems just as appropriate. -- 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=43346 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |andreas.jonsson@kreablo.se |ity.org | Priority|P5 - low |P3 -- 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=43346 Andreas Jonsson <andreas.jonsson@kreablo.se> 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=43346 --- Comment #1 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- Created attachment 203840 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203840&action=edit Bug 43346: unit test for payment without userenv MarkIssueReturned needlessly fails when called from a session with no logged in user such as a script or anonymous callback. A specific application where this is a problem when completing a payment transaction in a plugin for opac online payment wich may be done via polling or callback. This unit test verifies that a payment can be completed when paying a fee for a lost item with MarkLostItemsAsReturned set to onpayment and no userenv set. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43346 --- Comment #2 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- Created attachment 203841 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203841&action=edit Bug 43346: MarkIssueReturned with no userenv Since it is not clear what checkin_library signifies when marking an issue on a lost item as returned we might as well fallback on setting it to the issuing library when there is no userenv. Test plan * Run the unit test t/db_dependent/Koha/Account/Line.t -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org