Bug 11319: [QA follow-up] Remove a warning from GetModificationTemplates

Removes this warning: Use of uninitialized value $template_id in string eq
at C4/MarcModificationTemplates.pm line 84.

GetModificationTemplates has no template_id if called from
marc_modification_templates.pl without operation (first click from
interface) and from tools/stage-marc-import.pl.

Slightly adjusted the POD lines accordingly.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Marcel de Rooy 2014-10-31 10:14:16 +01:00 committed by Tomas Cohen Arazi
parent c9816945fd
commit 44cb93d77d
1 changed files with 5 additions and 3 deletions

View File

@ -66,9 +66,10 @@ files telling Koha what fields to insert data into.
=head2 GetModificationTemplates
my @templates = GetModificationTemplates( [ $template_id ] );
my @templates = GetModificationTemplates( $template_id );
Passing optional $template_id marks it as the selected template.
Passing a $template_id will mark the given id as the selected template.
=cut
sub GetModificationTemplates {
@ -81,7 +82,8 @@ sub GetModificationTemplates {
my @templates;
while ( my $template = $sth->fetchrow_hashref() ) {
$template->{'selected'} = 1 if ( $template->{'template_id'} eq $template_id );
$template->{'selected'} = 1
if $template_id && $template->{'template_id'} eq $template_id;
push( @templates, $template );
}