[Bug 33885] New: Get HTTP 500 when retrieving orders created by a non-existent (deleted) user
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33885 Bug ID: 33885 Summary: Get HTTP 500 when retrieving orders created by a non-existent (deleted) user Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: slavashishkin@gmail.com QA Contact: testopia@bugs.koha-community.org Depends on: 33293 Problem description: Occurs for orders where 'created_by' is NULL with the message in log: DBIC result _type isn't of the _type Borrower at /usr/share/koha/lib/Koha/Objects.pm line 463. This did not occur before in version 22.11 because there was no modal and the logic was different. Generally, according to the design, it is assumed that 'created_by' can be NULL, for example, due to a constraint that cleans it when the borrower record is deleted from the database. Steps to reproduce: 1. Create a superuser. 2. Add an order to the cart as a new user. 3. Delete the new user from the system. 4. Go to the orders section and select an order created by the non-existent user. 5. Click the "Get Order" button. Expected behavior: When attempting to retrieve an order created by a non-existent user, a confirmation pop-up window should appear for order retrieval. Actual behavior: Clicking the "Receive" button results in a JS alert with 'error 500 / The system is unable to process the request and returns an internal server error' message. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33293 [Bug 33293] Use template wrapper for tabs: Holds -- 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=33885 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33885 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com Depends on|33293 |8179 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8179 [Bug 8179] Receiving multiple order lines at once https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33293 [Bug 33293] Use template wrapper for tabs: Holds -- 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=33885 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart+koha@gmail. |ity.org |com Severity|major |critical -- 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=33885 Jonathan Druart <jonathan.druart+koha@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=33885 --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 152080 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152080&action=edit Bug 33885: Make Koha::Acq::Order->creator return undef if no creator If the account of the creator of an order has been deleted we should return undef here, instead of crashing with GET /api/v1/acquisitions/orders: unhandled exception (Mojo::Exception)<<DBIC result _type isn't of the _type Borrower at /kohadevbox/koha/Koha/Objects.pm line 445. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33885 --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 152081 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152081&action=edit Bug 33885: Prevent JS crash if creator does no longer exist JS error in the console was Uncaught TypeError: row.creator is null -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33885 David Nind <david@davidnind.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=33885 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152080|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 152137 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152137&action=edit Bug 33885: Make Koha::Acq::Order->creator return undef if no creator If the account of the creator of an order has been deleted we should return undef here, instead of crashing with GET /api/v1/acquisitions/orders: unhandled exception (Mojo::Exception)<<DBIC result _type isn't of the _type Borrower at /kohadevbox/koha/Koha/Objects.pm line 445. Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33885 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152081|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 152138 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152138&action=edit Bug 33885: Prevent JS crash if creator does no longer exist JS error in the console was Uncaught TypeError: row.creator is null Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33885 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Text to go in the| |This fixes an issue that release notes| |prevents the receiving of | |items where the user who | |created the order has been | |deleted. When clicking on | |'Receive' for an item, this | |error was displayed: | |"Something went wrong when | |loading the table. | |500: | |Internal Server Error." --- Comment #5 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. Edited user Henry Acevedo: set permissions so that Henry is a superlibrarian, change username (to Henry) and password (Policy10) so that you can log is as Henry. 2. Login as Henry and: - create a basket - add an item to the basket - close the basket 3. Login as user koha. 4. Delete the Henry Acevedo user. 5. Go to receive the order - when selecting 'Receive' in the table that lists the items ordered, you get this pop up error: "Something went wrong when loading the table. 500: Internal Server Error." 6. Apply the patch, refresh the page listing the items to receive, click 'Receive' ==> the receive window is now displayed without any errors. Reference: - IRC chat on how to replicate the issue: https://irc.koha-community.org/koha/2023-06-07#i_2490125 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33885 Tomás Cohen Arazi <tomascohen@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=33885 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152137|0 |1 is obsolete| | --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 152413 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152413&action=edit Bug 33885: Make Koha::Acq::Order->creator return undef if no creator If the account of the creator of an order has been deleted we should return undef here, instead of crashing with GET /api/v1/acquisitions/orders: unhandled exception (Mojo::Exception)<<DBIC result _type isn't of the _type Borrower at /kohadevbox/koha/Koha/Objects.pm line 445. Signed-off-by: David Nind <david@davidnind.com> 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=33885 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152138|0 |1 is obsolete| | --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 152414 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152414&action=edit Bug 33885: Prevent JS crash if creator does no longer exist JS error in the console was Uncaught TypeError: row.creator is null Signed-off-by: David Nind <david@davidnind.com> 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=33885 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.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=33885 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33885 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.11.00 |23.11.00,23.05.01 released in| | CC| |fridolin.somers@biblibre.co | |m Status|Pushed to master |Pushed to stable --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.01 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33885 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |pedro.amorim@ptfs-europe.co | |m Status|Pushed to stable |RESOLVED --- Comment #10 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Missing dependencies for 22.11.x. Not pushing. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org