On circulation.pl and moremember.pl the "see highlighted items below" link goes to #checkouts, but there is no div #checkouts instead of #checkouts_panel
Even with `*_panel` the behavior is still odd if you don't "Always show checkouts automatically". Clicking "See highlighted items below:" should expand the checkout table if it is not already.
Adding a double event onclick="$('#issues-table-load-immediately').click(); $('#issues-table-load-immediately').click();" to the checkouts_panel href text link fixes this without need to create a new function that checks the existence of the issues datatable (without the check I get a popup error DataTables warning: table id=issues-table - Cannot reinitialise DataTable if I press on the "See highlighted items below" text link again). It's a dirty fix that simulates two clicks on the Always show checkouts automatically checkbox. Is this acceptable?
Created attachment 171441 [details] [review] Bug 35987: Fix broken See highlighted items below link
Can we get a test plan? https://wiki.koha-community.org/wiki/Commit_messages
Created attachment 173769 [details] [review] Bug 35987: Fix broken See highlighted items below link Signed-off-by: Magnus Enger <magnus@libriotech.no> Test plan with KTD: - Issue a couple of items to a patron, and make sure one of them is overdue. - Make sure "Always show checkouts automatically" is not checked - Reload the page - Click on the link in "Overdues: Patron has ITEMS OVERDUE See highlighted items below" - Nothing happens - Apply the patch, restart_all, reload the "Check out" page for the patron - Click on the link again, and the active loans should be shown
Created attachment 174060 [details] [review] Bug 35987: Fix broken See highlighted items below link Signed-off-by: Magnus Enger <magnus@libriotech.no> Test plan with KTD: - Issue a couple of items to a patron, and make sure one of them is overdue. - Make sure "Always show checkouts automatically" is not checked - Reload the page - Click on the link in "Overdues: Patron has ITEMS OVERDUE See highlighted items below" - Nothing happens - Apply the patch, restart_all, reload the "Check out" page for the patron - Click on the link again, and the active loans should be shown Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Pushed for 24.11! Well done everyone, thank you!
Backported to 24.05.x for upcoming 24.05.06
Shouldnt we avoid onclick attributes ? See https://wiki.koha-community.org/wiki/Coding_Guidelines JS9: Avoid the use of event attributes like "onclick" to attach events
(In reply to Fridolin Somers from comment #9) > Shouldnt we avoid onclick attributes ? > See https://wiki.koha-community.org/wiki/Coding_Guidelines > JS9: Avoid the use of event attributes like "onclick" to attach events Yes you're right - I think we decided the dirty fix was needed to correct this quickly, but we should get a better fix in that aligns with our coding guidelines
(In reply to Fridolin Somers from comment #9) > Shouldnt we avoid onclick attributes ? > See https://wiki.koha-community.org/wiki/Coding_Guidelines > JS9: Avoid the use of event attributes like "onclick" to attach events 100% I'm glad this was for the staff interface and not the OPAC, as I've been working quite hard to remove all inline Javascript handlers from the OPAC in preparation of Content-Security-Policy implementation.