In the OPAC, when a patron clicks the "renew" link for an item they get an error: op must be set at /kohadevbox/koha/opac/opac-renew.pl line 36 in (eval) at /kohadevbox/koha/opac/opac-renew.pl line 36 33: my $query = CGI->new; 34: my $op = $query->param('op') || q{}; 35: 36: die "op must be set" unless $op eq 'cud-renew'; ... To replicate (using KTD): 1. Check some items out to a patron 2. Set the username and apssword for the patron so that you can log in as that patron. 3. Log in to the OAPC as that patron. 4. Go to Your account > Summary (the default landing page after you log in). 5. Click "Renew" for one of the items. 6. You get the error as above.
It seems the error results from l.456 in [`opac.tt`](https://github.com/Koha-Community/Koha/blob/8ab3989654b900cef2954c469b12ddce4375c9b8/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt#L456) where the URL generated does not add the missing parameter.
Created attachment 167860 [details] [review] Bug 37111: Turn Renew link into a POST form To test: 1. Check some items out to a patron 2. Set the username and apssword for the patron so that you can log in as that patron. 3. Log in to the OAPC as that patron. 4. Go to Your account > Summary (the default landing page after you log in). 5. Click "Renew" for one of the items. 6. You get the error as above. 7. APPLY PATCH 8. Try steps 1 -5 again, you should not get an error.
I think the link to renew needs to be a POST form.
Thanks Lucas for looking at this so quickly! If I tick the box and select "Renew selected" above the table header or at the bottom of the table, it works as expected. (No change from before the patch.) If I select "Renew all" above the table header or at the bottom of the table, I get a pop-up message, "Nothing has been selected. Check the box for each item you want to renew". (This was working before the patch.) If I click the "Renew" button for the individual item, I'm still getting the error. Also, is it possible to leave "Renew" in the table for an individual item as a text link? It looks quite big and out of place at the moment.
The whole table is wrapped in a <form> so you can't put individual forms inside the table. I think our most common solution for that is to but the "batch" form after the table and use JS to populate the selections.
(In reply to Owen Leonard from comment #5) > The whole table is wrapped in a <form> so you can't put individual forms > inside the table. I think our most common solution for that is to but the > "batch" form after the table and use JS to populate the selections. We now have a method to submit a link as a form on bug 36246
Created attachment 167866 [details] [review] Bug 37111: Add submit-form asset to OPAC assets
Created attachment 167867 [details] [review] Bug 37111: Fix renew link on opac-user.tt To test: 1. Check some items out to a patron 2. Set the username and apssword for the patron so that you can log in as that patron. 3. Log in to the OAPC as that patron. 4. Go to Your account > Summary (the default landing page after you log in). 5. Click "Renew" for one of the items. 6. You get the error as above. 7. APPLY PATCH 8. Try steps 1 -5 again, you should not get an error.
Thanks everyone, new patchset submitted.
Created attachment 167869 [details] [review] Bug 37111: Add submit-form asset to OPAC assets Signed-off-by: David Nind <david@davidnind.com>
Created attachment 167870 [details] [review] Bug 37111: Fix renew link on opac-user.tt To test: 1. Check some items out to a patron 2. Set the username and apssword for the patron so that you can log in as that patron. 3. Log in to the OAPC as that patron. 4. Go to Your account > Summary (the default landing page after you log in). 5. Click "Renew" for one of the items. 6. You get the error as above. 7. APPLY PATCH 8. Try steps 1 -5 again, you should not get an error. Signed-off-by: David Nind <david@davidnind.com>
Created attachment 167921 [details] [review] Bug 37111: Add submit-form asset to OPAC assets Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Alexander Wagner <alexander.wagner@desy.de>
Created attachment 167922 [details] [review] Bug 37111: Fix renew link on opac-user.tt To test: 1. Check some items out to a patron 2. Set the username and apssword for the patron so that you can log in as that patron. 3. Log in to the OAPC as that patron. 4. Go to Your account > Summary (the default landing page after you log in). 5. Click "Renew" for one of the items. 6. You get the error as above. 7. APPLY PATCH 8. Try steps 1 -5 again, you should not get an error. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Alexander Wagner <alexander.wagner@desy.de>
Thanks for the quick fix! :)
Created attachment 168103 [details] [review] Bug 37111: (follow-up) data attribute names should be lowercase See Bug 37190 Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Adding RM_Priority - please QA as this affects end users.
This won't work as is because Bug 37190 was RESOLVED INVALID. I will make the necessary changes.
Isn't the necessary change just to obsolete your followup patch? I applied the first two patches, added a data-confirmation-msg to the link, and it worked perfectly, submit-form.js saw it as confirmationMsg and asked the question and acted appropriately.
(In reply to Phil Ringnalda (back in August) from comment #18) > Isn't the necessary change just to obsolete your followup patch? I applied > the first two patches, added a data-confirmation-msg to the link, and it > worked perfectly, submit-form.js saw it as confirmationMsg and asked the > question and acted appropriately. I've having no issues with or without the followup. It seems better to leave it off in that case.
Created attachment 169157 [details] [review] Bug 37111: Add submit-form asset to OPAC assets Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Alexander Wagner <alexander.wagner@desy.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 169158 [details] [review] Bug 37111: Fix renew link on opac-user.tt To test: 1. Check some items out to a patron 2. Set the username and apssword for the patron so that you can log in as that patron. 3. Log in to the OAPC as that patron. 4. Go to Your account > Summary (the default landing page after you log in). 5. Click "Renew" for one of the items. 6. You get the error as above. 7. APPLY PATCH 8. Try steps 1 -5 again, you should not get an error. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Alexander Wagner <alexander.wagner@desy.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Thanks for all the hard work! Pushed to main for the next 24.11.00 release as RM Assistant
Backported to 24.05.x for upcoming 24.05.04
Depends on Bug 34478 not in 23.11.x
Bug fix, no change to UI, no changes required to the documentation.