Summary: | Get HTTP 500 when retrieving orders created by a non-existent (deleted) user | ||
---|---|---|---|
Product: | Koha | Reporter: | Slava Shishkin <slavashishkin> |
Component: | Acquisitions | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | critical | ||
Priority: | P5 - low | CC: | david, dcook, fridolin.somers, jonathan.druart, pedro.amorim |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: |
This fixes an issue that 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."
|
|
Version(s) released in: |
23.11.00,23.05.01
|
Circulation function: | |
Bug Depends on: | 8179 | ||
Bug Blocks: | |||
Attachments: |
Bug 33885: Make Koha::Acq::Order->creator return undef if no creator
Bug 33885: Prevent JS crash if creator does no longer exist Bug 33885: Make Koha::Acq::Order->creator return undef if no creator Bug 33885: Prevent JS crash if creator does no longer exist Bug 33885: Make Koha::Acq::Order->creator return undef if no creator Bug 33885: Prevent JS crash if creator does no longer exist |
Description
Slava Shishkin
2023-06-02 07:58:35 UTC
Created attachment 152080 [details] [review] 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. Created attachment 152081 [details] [review] Bug 33885: Prevent JS crash if creator does no longer exist JS error in the console was Uncaught TypeError: row.creator is null Created attachment 152137 [details] [review] 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> Created attachment 152138 [details] [review] 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> 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 Created attachment 152413 [details] [review] 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> Created attachment 152414 [details] [review] 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> Pushed to master for 23.11. Nice work everyone, thanks! Pushed to 23.05.x for 23.05.01 Missing dependencies for 22.11.x. Not pushing. |