Bug 33504 - ILS-DI does not record renewer_id for renewals creating issue with renewal history view
Summary: ILS-DI does not record renewer_id for renewals creating issue with renewal hi...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Web services (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Martin Renvoize
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-12 10:09 UTC by Martin Renvoize
Modified: 2023-12-28 20:44 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.06,22.05.13


Attachments
Bug 33504: Update patron_to_html to deal with null (1.22 KB, patch)
2023-04-12 10:51 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33504: Update patron_to_html to deal with null (1.76 KB, patch)
2023-04-25 11:00 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 33504: Update patron_to_html to deal with null (1.76 KB, patch)
2023-05-01 12:51 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 Martin Renvoize 2023-04-12 10:09:37 UTC
With the introduction on new code around renewals, we updated the REST API and other renewal avenues, but neglected ILD-DI
Comment 1 Martin Renvoize 2023-04-12 10:19:41 UTC
Oh.. I'm wrong.. it's not that we don't handle it.... it's that we somehow don't have a userenv for ils-di sessions if I'm not mistaken?
Comment 2 Martin Renvoize 2023-04-12 10:37:04 UTC
The symptom here is that the renewal history modal fails to load as the renewer_id isn't set for ils-di renewals.
Comment 3 Martin Renvoize 2023-04-12 10:51:55 UTC Comment hidden (obsolete)
Comment 4 Martin Renvoize 2023-04-12 10:54:05 UTC
This fixes the symptom, not the cause.

To test.
1) Use ILS-DI to renew an checkout
2) View the circulation history for the item
3) Click the 'View' button next to the count of renewals
4) Note that the modal just stalls at 'Retrieving renewals'
5) Apply the patch
6) Now the 'retrieving renewals' message should list the renewals instead.
Comment 5 Magnus Enger 2023-04-25 11:00:59 UTC
Created attachment 150184 [details] [review]
Bug 33504: Update patron_to_html to deal with null

In the patron_to_html function we were dealing explicitly with the case
where patron may be passed undefined, but forgetting that it may be
returned as 'null' from the api too.  Changing from `( patron ===
undefined )` to `( patron == null )` is the recommended approach for
detecting 'undefined or null' in javascript.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised. Martin's test plan from Bugzilla:

To test.
1) Use ILS-DI to renew an checkout
2) View the circulation history for the item
3) Click the 'View' button next to the count of renewals
4) Note that the modal just stalls at 'Retrieving renewals'
5) Apply the patch
6) Now the 'retrieving renewals' message should list the renewals instead.

Note that step 2 should be something like "Go to the "Circulation
history" of the patron.

https://bugs.koha-community.org/show_bug.cgi?id=22504
Comment 6 David Nind 2023-04-29 19:30:15 UTC
Hi Magnus

You may wish to change the status to signed off. 8-)

And maybe remove the Bugzilla link at the end.

David
Comment 7 Katrin Fischer 2023-05-01 12:51:03 UTC
Created attachment 150451 [details] [review]
Bug 33504: Update patron_to_html to deal with null

In the patron_to_html function we were dealing explicitly with the case
where patron may be passed undefined, but forgetting that it may be
returned as 'null' from the api too.  Changing from `( patron ===
undefined )` to `( patron == null )` is the recommended approach for
detecting 'undefined or null' in javascript.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised. Martin's test plan from Bugzilla:

To test.
1) Use ILS-DI to renew an checkout
2) View the circulation history for the item
3) Click the 'View' button next to the count of renewals
4) Note that the modal just stalls at 'Retrieving renewals'
5) Apply the patch
6) Now the 'retrieving renewals' message should list the renewals instead.

Note that step 2 should be something like "Go to the "Circulation
history" of the patron.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Tomás Cohen Arazi 2023-05-05 12:17:39 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 9 Martin Renvoize 2023-05-11 11:08:13 UTC
Many hands makes light work, thankyou everyone!

Pushed to 22.11.x for the next release
Comment 10 Lucas Gass 2023-05-15 22:08:40 UTC
Backported to 22.05.x for upcoming 22.05.13