Bug 19059: Fix compilation issues
[koha.git] / clubs / clubs-add-modify.pl
index d1873d4..dabac24 100755 (executable)
@@ -44,7 +44,13 @@ my $schema = Koha::Database->new()->schema();
 
 my $id = $cgi->param('id');
 my $club = $id ? Koha::Clubs->find($id) : Koha::Club->new();
-my $stored = $cgi->param('name') ? $id ? 'updated' : 'stored' : undef;
+
+my $stored =
+    $cgi->param('name')
+  ? $id
+      ? 'updated'
+      : 'stored'
+  : undef;
 
 my $club_template_id = $cgi->param('club_template_id');
 my $club_template = $club->club_template() || Koha::Club::Templates->find($club_template_id);
@@ -58,10 +64,10 @@ $date_end = $date_end ? dt_from_string($date_end) : undef;
 if ( $cgi->param('name') ) {    # Update or create club
     $club->set(
         {
-            club_template_id => $cgi->param('club_template_id') || undef,
-            name             => $cgi->param('name')             || undef,
-            description      => $cgi->param('description')      || undef,
-            branchcode       => $cgi->param('branchcode')       || undef,
+            club_template_id => scalar $cgi->param('club_template_id') || undef,
+            name             => scalar $cgi->param('name')             || undef,
+            description      => scalar $cgi->param('description')      || undef,
+            branchcode       => scalar $cgi->param('branchcode')       || undef,
             date_start       => $date_start,
             date_end         => $date_end,
             date_updated     => dt_from_string(),