Bug 37524 - Pressing "Renew all" redirects user to "Export data" tool if one of the items is not renewable
Summary: Pressing "Renew all" redirects user to "Export data" tool if one of the items...
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Emmi Takkinen
QA Contact: Paul Derscheid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-30 11:51 UTC by Emmi Takkinen
Modified: 2024-11-18 16:16 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.06
Circulation function: holds


Attachments
Bug 37524: Do not attempt to renew check outs if there is nothing to renew (2.50 KB, patch)
2024-07-30 13:04 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37524: Do not attempt to renew check outs if there is nothing to renew (2.55 KB, patch)
2024-07-30 14:25 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 37524: Do not attempt to renew check outs if there is nothing to renew (2.61 KB, patch)
2024-09-13 15:29 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37524: (QA follow-up) Tidy affected block in checkouts.js (1.70 KB, patch)
2024-09-13 15:32 UTC, Paul Derscheid
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Emmi Takkinen 2024-07-30 11:51:19 UTC
If patrons loans are not renewable and one hits "Renew all" button in patrons "Check out" page, Koha is redirected to "Export data" tool.

To reproduce:
1. Find patron with loan(s) which renewals count has hit the maximum limit of renewals.
2. Press "Renew all" button.
=> Koha is redirected to "Export data" tool.
Comment 1 Emmi Takkinen 2024-07-30 12:17:06 UTC
Changing this as minor bug.
Comment 2 Emmi Takkinen 2024-07-30 12:32:54 UTC
There is something wrong with call to renew_all function, I'm seeing following error in browsers console.

>Uncaught TypeError: renew_all(...) is undefined

which points to this part in checkouts.js


renew_all(item_ids, renew).then(() => {
    // Refocus on barcode field if it exists
    if ( $("#barcode").length ) {
        $("#barcode").focus();
    }

    if ( refresh_table ) {
        RefreshIssuesTable();
    }
    $('#RenewChecked, #CheckinChecked').prop('disabled' , true );
});
Comment 3 Emmi Takkinen 2024-07-30 13:04:06 UTC
Created attachment 169859 [details] [review]
Bug 37524: Do not attempt to renew check outs if there is nothing to renew

If patrons loans are not renewable and one hits "Renew all"
button in patrons "Check out" page, Koha is redirected to
"Export data" tool. This happens because when there is
nothing to renew call to function renew_all produces error:
"Uncaught TypeError: renew_all(...) is undefined". This
patch prevents call to this function and adds alert to
inform user that there are no items to be renewed.

To reproduce:
1. Find patron with check outs which renewals count has hit
the maximum limit of renewals.
2. Press "Renew all" button.
=> Koha is redirected to "Export data" tool.
3. Apply this patch.
4. Try to renew check outs again.
=> Alert pop up is displayed.

Sponsored-by: Koha-Suomi Oy
Comment 4 Roman Dolny 2024-07-30 14:25:17 UTC
Created attachment 169866 [details] [review]
Bug 37524: Do not attempt to renew check outs if there is nothing to renew

If patrons loans are not renewable and one hits "Renew all"
button in patrons "Check out" page, Koha is redirected to
"Export data" tool. This happens because when there is
nothing to renew call to function renew_all produces error:
"Uncaught TypeError: renew_all(...) is undefined". This
patch prevents call to this function and adds alert to
inform user that there are no items to be renewed.

To reproduce:
1. Find patron with check outs which renewals count has hit
the maximum limit of renewals.
2. Press "Renew all" button.
=> Koha is redirected to "Export data" tool.
3. Apply this patch.
4. Try to renew check outs again.
=> Alert pop up is displayed.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 5 Paul Derscheid 2024-09-13 15:29:15 UTC
Created attachment 171481 [details] [review]
Bug 37524: Do not attempt to renew check outs if there is nothing to renew

If patrons loans are not renewable and one hits "Renew all"
button in patrons "Check out" page, Koha is redirected to
"Export data" tool. This happens because when there is
nothing to renew call to function renew_all produces error:
"Uncaught TypeError: renew_all(...) is undefined". This
patch prevents call to this function and adds alert to
inform user that there are no items to be renewed.

To reproduce:
1. Find patron with check outs which renewals count has hit
the maximum limit of renewals.
2. Press "Renew all" button.
=> Koha is redirected to "Export data" tool.
3. Apply this patch.
4. Try to renew check outs again.
=> Alert pop up is displayed.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 6 Paul Derscheid 2024-09-13 15:32:00 UTC
Created attachment 171482 [details] [review]
Bug 37524: (QA follow-up) Tidy affected block in checkouts.js
Comment 7 Katrin Fischer 2024-09-16 08:54:10 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 8 Lucas Gass (lukeg) 2024-11-18 16:16:16 UTC
Backported to 24.05.x for upcoming 24.05.06