Bug 32037 - Circulation module in action logs has bad links for deleted items
Summary: Circulation module in action logs has bad links for deleted items
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-28 14:42 UTC by Nick Clemens (kidclamp)
Modified: 2023-12-28 20:44 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.09, 21.11.16
Circulation function:


Attachments
Bug 32037: Check for existence of object before building link (6.28 KB, patch)
2022-10-28 14:50 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 32037: Check for existence of object before building link (6.33 KB, patch)
2022-10-28 20:47 UTC, David Nind
Details | Diff | Splinter Review
Bug 32037: Check for existence of object before building link (6.38 KB, patch)
2022-11-02 17:27 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2022-10-28 14:42:30 UTC
The action log viewer attempts to build links to items/biblios etc.

These links are broken when the item is deleted

We are fetching the object to determine link values, so we should simply display the info field when no object is found
Comment 1 Nick Clemens (kidclamp) 2022-10-28 14:50:47 UTC
Created attachment 142775 [details] [review]
Bug 32037: Check for existence of object before building link

This patch adds a check on the existence of the object and passes this to the template

I also drop a level of IF by moving to ELSIF

To test:
 1 - Enable ReturnLog amd IssueLog
 2 - Checkout an item to a patron
 3 - Return it
 4 - View 'Modification log' tab of the borrwer
 5 - Note item links, test them, they work
 6 - Delete the item
 7 - Reload and try links again, they do not work
 8 - Apply patch
 9 - Reload, no more links
10 - Checkout and return another item
11 - This one has links, and they work as before
Comment 2 David Nind 2022-10-28 20:47:30 UTC
Created attachment 142790 [details] [review]
Bug 32037: Check for existence of object before building link

This patch adds a check on the existence of the object and passes this to the template

I also drop a level of IF by moving to ELSIF

To test:
 1 - Enable ReturnLog amd IssueLog
 2 - Checkout an item to a patron
 3 - Return it
 4 - View 'Modification log' tab of the borrwer
 5 - Note item links, test them, they work
 6 - Delete the item
 7 - Reload and try links again, they do not work
 8 - Apply patch
 9 - Reload, no more links
10 - Checkout and return another item
11 - This one has links, and they work as before

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2022-11-02 12:32:43 UTC
Nick, Nick, Nick... Assignee! :)
Comment 4 Katrin Fischer 2022-11-02 17:27:29 UTC
Created attachment 143021 [details] [review]
Bug 32037: Check for existence of object before building link

This patch adds a check on the existence of the object and passes this to the template

I also drop a level of IF by moving to ELSIF

To test:
 1 - Enable ReturnLog amd IssueLog
 2 - Checkout an item to a patron
 3 - Return it
 4 - View 'Modification log' tab of the borrwer
 5 - Note item links, test them, they work
 6 - Delete the item
 7 - Reload and try links again, they do not work
 8 - Apply patch
 9 - Reload, no more links
10 - Checkout and return another item
11 - This one has links, and they work as before

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Tomás Cohen Arazi (tcohen) 2022-11-04 22:25:50 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 6 Lucas Gass (lukeg) 2023-01-18 21:16:42 UTC
Backpoted to 22.05.x for upcoming 22.05.09
Comment 7 Arthur Suzuki 2023-01-26 09:54:40 UTC
pushed to 21.11.x for 21.11.16
Comment 8 Wainui Witika-Park 2023-03-15 01:28:07 UTC
Not backported to 21.05.x