diff --git a/lib/Pear/LocalLoop/Controller/Admin/Categories.pm b/lib/Pear/LocalLoop/Controller/Admin/Categories.pm index c4aceeb..b37900d 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Categories.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Categories.pm @@ -19,7 +19,7 @@ sub create { my $c = shift; my $validation = $c->validation; - $validation->required('category', 'trim')->like(qr/^[\w]*$/)->not_in_resultset('name', $c->result_set); + $validation->required('category', 'trim')->not_in_resultset('name', $c->result_set); my $category_name = $validation->param('category'); diff --git a/lib/Pear/LocalLoop/Controller/Api/Stats.pm b/lib/Pear/LocalLoop/Controller/Api/Stats.pm index 8545406..cd348c3 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Stats.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Stats.pm @@ -93,7 +93,7 @@ sub post_customer { my @all_weeks = $week_transaction_rs->all; my $first = $all_weeks[0]->get_column('count') || 0; - my $second = $all_weeks[1]->get_column('count') || 0; + my $second = defined $all_weeks[1] ? $all_weeks[1]->get_column('count') || 0 : 0; my $max = max( map { $_->get_column('count') } @all_weeks ); my $sum = sum( map { $_->get_column('count') } @all_weeks ); my $count = $week_transaction_rs->count;