Bugzilla – Attachment 171295 Details for
Bug 27182
Add ability to rename a MARC modification template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27182: Rework RenameModificationTemplate to not pass hashref as argument
Bug-27182-Rework-RenameModificationTemplate-to-not.patch (text/plain), 2.75 KB, created by
Lucas Gass (lukeg)
on 2024-09-10 23:29:58 UTC
(
hide
)
Description:
Bug 27182: Rework RenameModificationTemplate to not pass hashref as argument
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-09-10 23:29:58 UTC
Size:
2.75 KB
patch
obsolete
>From 3cb911e27ada535d77d9af5cf0911a533ab1ca87 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 10 Sep 2024 23:26:35 +0000 >Subject: [PATCH] Bug 27182: Rework RenameModificationTemplate to not pass > hashref as argument > >--- > C4/MarcModificationTemplates.pm | 10 ++++++---- > t/db_dependent/MarcModificationTemplates.t | 4 ++-- > tools/marc_modification_templates.pl | 3 ++- > 3 files changed, 10 insertions(+), 7 deletions(-) > >diff --git a/C4/MarcModificationTemplates.pm b/C4/MarcModificationTemplates.pm >index 52f6920ac15..9ba7b8ff96e 100644 >--- a/C4/MarcModificationTemplates.pm >+++ b/C4/MarcModificationTemplates.pm >@@ -170,11 +170,13 @@ sub DelModificationTemplate { > =cut > > sub RenameModificationTemplate { >- my ( $template_name, $template_id ) = @_; >+ my ($args) = @_; >+ my $template_name = $args->{'template_name'}; >+ my $template_id = $args->{'template_id'}; > >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare("UPDATE marc_modification_templates SET name = ? WHERE template_id = ?"); >- $sth->execute( $template_name, $template_id ); >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare("UPDATE marc_modification_templates SET name = ? WHERE template_id = ?"); >+ $sth->execute( $template_name, $template_id ); > } > > =head2 >diff --git a/t/db_dependent/MarcModificationTemplates.t b/t/db_dependent/MarcModificationTemplates.t >index 67e5dda2d5e..56c036736a4 100755 >--- a/t/db_dependent/MarcModificationTemplates.t >+++ b/t/db_dependent/MarcModificationTemplates.t >@@ -391,8 +391,8 @@ subtest 'RenameModificationTemplate' => sub { > $dbh->do(q|DELETE FROM marc_modification_templates|); > my $template_id = AddModificationTemplate("koah"); > my $template_id2 = AddModificationTemplate("sma"); >- RenameModificationTemplate("koha", $template_id); >- RenameModificationTemplate("sam", $template_id2); >+ RenameModificationTemplate({ 'template_name' => "koha", 'template_id' => $template_id}); >+ RenameModificationTemplate({ 'template_name' => "sam", 'template_id' => $template_id2}); > my @templates = GetModificationTemplates(); > is_deeply( [map{$_->{name}} @templates], ['koha', 'sam'] ); > }; >diff --git a/tools/marc_modification_templates.pl b/tools/marc_modification_templates.pl >index eaf9a98a404..ecf32e5646a 100755 >--- a/tools/marc_modification_templates.pl >+++ b/tools/marc_modification_templates.pl >@@ -57,7 +57,8 @@ if ( $op eq "cud-create_template" ) { > $template_id = ''; > > } elsif ( $op eq "cud-rename_template" ) { >- RenameModificationTemplate( scalar $cgi->param('template_name'), $template_id ); >+ RenameModificationTemplate( >+ { 'template_name' => scalar $cgi->param('template_name'), 'template_id' => $template_id } ); > > } elsif ( $op eq "cud-add_action" ) { > >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27182
:
168041
|
168042
|
168045
|
168077
|
168079
|
168080
|
168081
|
168082
|
168083
|
171294
| 171295