@@ -, +, @@ --- C4/MarcModificationTemplates.pm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/C4/MarcModificationTemplates.pm +++ a/C4/MarcModificationTemplates.pm @@ -107,10 +107,7 @@ sub AddModificationTemplate { my $sth = $dbh->prepare("INSERT INTO marc_modification_templates ( name ) VALUES ( ? )"); $sth->execute( $template_name ); - $sth = $dbh->prepare("SELECT * FROM marc_modification_templates WHERE name = ?"); - $sth->execute( $template_name ); - my $row = $sth->fetchrow_hashref(); - my $template_id = $row->{'template_id'}; + my $template_id = $dbh->last_insert_id(undef, undef, 'marc_modification_templates'); if ( $template_id_copy ) { my @actions = GetModificationTemplateActions( $template_id_copy ); --