Bug 40031 - Creation of a new MARC modification template should redirect to have the template ID in the URL
Summary: Creation of a new MARC modification template should redirect to have the temp...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Raguram Gopinath
QA Contact: Lucas Gass (lukeg)
URL:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2025-05-29 18:40 UTC by Esther Melander
Modified: 2026-01-23 14:30 UTC (History)
6 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: Sponsored
Comma delimited list of Sponsors: Catalyst
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This updates the URL when adding a new MARC modification template (Cataloging > Batch editing > MARC modification templates). It adds the template ID so that you can directly link to the template. Previously, you had to click `Edit actions` from the list of templates, and couldn't directly link to the template to see the actions: - Previous URL after adding a template: STAFF-INTERFACE-URL/cgi-bin/koha/tools/marc_modification_templates.pl - New URL after adding a template: STAFF-INTERFACE-URL/cgi-bin/koha/tools/marc_modification_templates.pl?template_id=(template_id)&op=select_template
Version(s) released in:
26.05.00
Circulation function:


Attachments
Bug 40031: Redirect to add action page from add template form (1.56 KB, patch)
2026-01-21 02:48 UTC, Raguram Gopinath
Details | Diff | Splinter Review
Bug 40031: Redirect to add action page from add template form (1.61 KB, patch)
2026-01-21 11:03 UTC, David Nind
Details | Diff | Splinter Review
Bug 40031: Redirect to add action page from add template form (1.67 KB, patch)
2026-01-21 21:38 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Esther Melander 2025-05-29 18:40:05 UTC
To replicate:

1. Go to Cataloging > MARC Modification templates

note the URL = /cgi-bin/koha/tools/marc_modification_templates.pl

2. Add a new template

notice the URL = /cgi-bin/koha/tools/marc_modification_templates.pl

It would be nice if the template name is incorporated into the URL so the URL can be shared and the user can be taken directly to a template. Currently the user has to go to /cgi-bin/koha/tools/marc_modification_templates.pl and search for the template to see the actions.
Comment 1 David Cook 2025-05-30 01:01:57 UTC
(In reply to Esther Melander from comment #0)
> To replicate:
> 
> 1. Go to Cataloging > MARC Modification templates
> 
> note the URL = /cgi-bin/koha/tools/marc_modification_templates.pl
> 
> 2. Add a new template
> 
> notice the URL = /cgi-bin/koha/tools/marc_modification_templates.pl
> 
> It would be nice if the template name is incorporated into the URL so the
> URL can be shared and the user can be taken directly to a template.
> Currently the user has to go to
> /cgi-bin/koha/tools/marc_modification_templates.pl and search for the
> template to see the actions.

Good point!

Although it wouldn't be the template name. It would be the template ID. For instance, if you go to edit the actions for the template, you'll have a URL like /cgi-bin/koha/tools/marc_modification_templates.pl?template_id=2&op=select_template

So the fix for this would be to add the new template with a POST and then after a successful add, it should redirect the user to /cgi-bin/koha/tools/marc_modification_templates.pl?template_id=<TEMPLATE ID>&op=select_template
Comment 2 David Cook 2025-05-30 01:02:25 UTC
I'm a bit time poor at the moment, but that should be a simple fix for someone.
Comment 3 David Cook 2025-05-30 01:03:07 UTC
Btw confirmed back to 23.11, but probably an issue for much older versions too
Comment 4 Aleisha Amohia 2026-01-20 23:16:33 UTC
Renaming so easier to understand what bug this is addressing
Comment 5 Raguram Gopinath 2026-01-21 02:48:38 UTC
Created attachment 191741 [details] [review]
Bug 40031: Redirect to add action page from add template form

Test plan:
1. Login to staff client.
2. Go to: Cataloging > MARC modification templates > New template
3. Give new template a name and click submit.
4. Following URL loads: http://localhost:8081/cgi-bin/koha/tools/marc_modification_templates.pl
If you are using KTD
5. Apply patch and restart services.
6. Repeat steps 2 and 3.
7. Following URL loads: http://localhost:8081/cgi-bin/koha/tools/marc_modification_templates.pl?template_id=(template_id)&op=select_template
8. You can now add actions for your new template.
Comment 6 David Nind 2026-01-21 11:03:32 UTC
Created attachment 191769 [details] [review]
Bug 40031: Redirect to add action page from add template form

Test plan:
1. Login to staff client.
2. Go to: Cataloging > MARC modification templates > New template
3. Give new template a name and click submit.
4. Following URL loads: http://localhost:8081/cgi-bin/koha/tools/marc_modification_templates.pl
If you are using KTD
5. Apply patch and restart services.
6. Repeat steps 2 and 3.
7. Following URL loads: http://localhost:8081/cgi-bin/koha/tools/marc_modification_templates.pl?template_id=(template_id)&op=select_template
8. You can now add actions for your new template.

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2026-01-21 11:11:20 UTC
I attempted a release note, not sure I got this right...
Comment 8 David Nind 2026-01-21 20:15:41 UTC
Thanks for the patch Raguram!
Comment 9 Lucas Gass (lukeg) 2026-01-21 21:38:58 UTC
Created attachment 191843 [details] [review]
Bug 40031: Redirect to add action page from add template form

Test plan:
1. Login to staff client.
2. Go to: Cataloging > MARC modification templates > New template
3. Give new template a name and click submit.
4. Following URL loads: http://localhost:8081/cgi-bin/koha/tools/marc_modification_templates.pl
If you are using KTD
5. Apply patch and restart services.
6. Repeat steps 2 and 3.
7. Following URL loads: http://localhost:8081/cgi-bin/koha/tools/marc_modification_templates.pl?template_id=(template_id)&op=select_template
8. You can now add actions for your new template.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 10 Lucas Gass (lukeg) 2026-01-21 21:39:40 UTC
Works good! Passing QA here. Thanks Raguram!
Comment 11 Lucas Gass (lukeg) 2026-01-23 14:30:12 UTC
Nice work everyone!

Pushed to main for 26.05