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);
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(),