Bug 27182 - Add ability to rename a MARC modification template
Summary: Add ability to rename a MARC modification template
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Sam Lau
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-09 18:49 UTC by Barbara Johnson
Modified: 2024-09-10 23:29 UTC (History)
9 users (show)

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


Attachments
Bug 27182: Unit tests (2.27 KB, patch)
2024-06-24 20:15 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 27182: Add ability to rename a MARC modification template (5.87 KB, patch)
2024-06-24 20:15 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 27182: (follow-up) Fix tidy warning (858 bytes, patch)
2024-06-24 20:44 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 27182: (follow-up) Fix typo in pm (750 bytes, patch)
2024-06-25 14:42 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 27182: (follow-up) Fix typo in pm (811 bytes, patch)
2024-06-25 15:26 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 27182: Unit tests (2.32 KB, patch)
2024-06-25 15:30 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 27182: Add ability to rename a MARC modification template (5.92 KB, patch)
2024-06-25 15:30 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 27182: (follow-up) Fix tidy warning (913 bytes, patch)
2024-06-25 15:30 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 27182: (follow-up) Fix typo in pm (866 bytes, patch)
2024-06-25 15:30 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 27182: Account for Bootstrap 5 changes (2.99 KB, patch)
2024-09-10 22:17 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 27182: Rework RenameModificationTemplate to not pass hashref as argument (2.75 KB, patch)
2024-09-10 23:29 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 Barbara Johnson 2020-12-09 18:49:05 UTC
It would be helpful to add the ability to rename a MARC modification template.  There are times when the name originally assigned isn't as descriptive as desired.  While it is currently possible to use the 'New template' button to duplicate the template and give it a new name that's not very obvious.  And then the old template would need to be deleted.  This takes time and it would be more efficient to have a button or action from the main MARC modification template screen for renaming.
Comment 1 Andrew Fuerste-Henry 2021-07-01 12:52:23 UTC
+1, this is a stilly functionality to leave out.
Comment 2 Miranda Nero 2024-03-20 16:56:14 UTC
Came here to file a bug about this myself. This would be extremely useful! 

A use case for me: I created a bunch of templates based on the specific MARC tags they were updating and they were all next to each other, but as we've created more templates, the original ones I created are now spread out. It would be helpful if I could rename them to include something at the beginning of each one so they would be sorted next to each other permanently.

Another use case: fixing typos!
Comment 3 Sam Lau 2024-06-24 20:15:38 UTC
Created attachment 168041 [details] [review]
Bug 27182: Unit tests

To test:
prove t/db_dependent/MarcModificationTemplates.t
Comment 4 Sam Lau 2024-06-24 20:15:40 UTC
Created attachment 168042 [details] [review]
Bug 27182: Add ability to rename a MARC modification template

This patch adds a new 'Rename template' button on the MARC modifications templates page.

To test:
1) Go to Cataloging -> MARC modification templates
2) Click the button at the top 'New template'. Name your template and press submit.
3) You should now be on the actions page for that template. Notice there isn't any options to rename your template.
4) Apply patch and restart_all
5) Notice that there is now a "Rename template' button.
6) Click this and rename your template and press submit.
7) Notice that the template name changed correctly.
8) Go back to the general MARC modifications templates page. Note the name of your template is correctly displayed in the table.
Comment 5 Sam Lau 2024-06-24 20:44:56 UTC
Created attachment 168045 [details] [review]
Bug 27182: (follow-up) Fix tidy warning
Comment 6 Lucas Gass (lukeg) 2024-06-24 22:56:00 UTC
Looks great, Sam. I notice 1 typo in C4/MarcModificationTemplates.pm:

 	

  RenameModificatoinTemplate( $template_name, $template_id );
Comment 7 Sam Lau 2024-06-25 14:42:21 UTC
Created attachment 168077 [details] [review]
Bug 27182: (follow-up) Fix typo in pm
Comment 8 ByWater Sandboxes 2024-06-25 15:26:49 UTC
Created attachment 168079 [details] [review]
Bug 27182: (follow-up) Fix typo in pm

Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Comment 9 Heather 2024-06-25 15:29:48 UTC
Worked great!  Just a wee thing here, "4) Apply patch and restart_all
5) Notice that there is now a "Rename template' button," probably for the documentation, that one needs to:

Select the 'Edit actions' button.
Then 'Rename template' will appear at the top; choose 'Rename template'

I've forgotten if I should change the Status on this bug to "Signed off," or if someone does then when it gets a second signoff?

Cheerio!!
h2
Comment 10 Lucas Gass (lukeg) 2024-06-25 15:30:22 UTC
Created attachment 168080 [details] [review]
Bug 27182: Unit tests

To test:
prove t/db_dependent/MarcModificationTemplates.t

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 11 Lucas Gass (lukeg) 2024-06-25 15:30:25 UTC
Created attachment 168081 [details] [review]
Bug 27182: Add ability to rename a MARC modification template

This patch adds a new 'Rename template' button on the MARC modifications templates page.

To test:
1) Go to Cataloging -> MARC modification templates
2) Click the button at the top 'New template'. Name your template and press submit.
3) You should now be on the actions page for that template. Notice there isn't any options to rename your template.
4) Apply patch and restart_all
5) Notice that there is now a "Rename template' button.
6) Click this and rename your template and press submit.
7) Notice that the template name changed correctly.
8) Go back to the general MARC modifications templates page. Note the name of your template is correctly displayed in the table.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 12 Lucas Gass (lukeg) 2024-06-25 15:30:27 UTC
Created attachment 168082 [details] [review]
Bug 27182: (follow-up) Fix tidy warning

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 13 Lucas Gass (lukeg) 2024-06-25 15:30:29 UTC
Created attachment 168083 [details] [review]
Bug 27182: (follow-up) Fix typo in pm

Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 14 Julian Maurice 2024-09-06 12:25:43 UTC
When I click "Rename template" nothing happens. There is no errors in the browser console.

Also RenameModificationTemplate needs to be rewritten because of https://wiki.koha-community.org/wiki/Coding_Guidelines#PERL16:_Hashrefs_should_be_used_as_arguments
Comment 15 Lucas Gass (lukeg) 2024-09-10 22:17:42 UTC
Created attachment 171294 [details] [review]
Bug 27182: Account for Bootstrap 5 changes
Comment 16 Lucas Gass (lukeg) 2024-09-10 23:29:58 UTC
Created attachment 171295 [details] [review]
Bug 27182: Rework RenameModificationTemplate to not pass hashref as argument