]> git.koha-community.org Git - koha.git/commit
Bug 33504: Update patron_to_html to deal with null
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 12 Apr 2023 10:49:51 +0000 (11:49 +0100)
committerLucas Gass <lucas@bywatersolutions.com>
Mon, 15 May 2023 21:57:41 +0000 (21:57 +0000)
commit8583d09b55ec59118e0ec62854994e1ddab531b1
tree8a0498eea4f14ed59c5ac45fb3ca114ab2de9d5e
parentd1e839d170c76f0d2a3869ba23ef38a1df239f9a
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 744ac4825ba9a346e2ad1c8e413d3d9423658512)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 31db36fb34843efe42ef3257d3d187c8611a53f7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc