diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/BathNES.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Roles/ConfirmValidation.pm | 2 | ||||
-rw-r--r-- | t/cobrand/westminster.t | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/Cobrand/BathNES.pm b/perllib/FixMyStreet/Cobrand/BathNES.pm index 743de74d5..dd1b93764 100644 --- a/perllib/FixMyStreet/Cobrand/BathNES.pm +++ b/perllib/FixMyStreet/Cobrand/BathNES.pm @@ -35,7 +35,7 @@ sub contact_extra_fields_validation { return unless $contact->get_extra_metadata('display_name'); my @contacts = $contact->body->contacts->not_deleted->search({ id => { '!=', $contact->id } }); - my %display_names = map { $_->get_extra_metadata('display_name') => 1 } @contacts; + my %display_names = map { ($_->get_extra_metadata('display_name') || '') => 1 } @contacts; if ($display_names{$contact->get_extra_metadata('display_name')}) { $errors->{display_name} = 'That display name is already in use'; } diff --git a/perllib/FixMyStreet/Roles/ConfirmValidation.pm b/perllib/FixMyStreet/Roles/ConfirmValidation.pm index 776230287..6474c94d1 100644 --- a/perllib/FixMyStreet/Roles/ConfirmValidation.pm +++ b/perllib/FixMyStreet/Roles/ConfirmValidation.pm @@ -24,7 +24,7 @@ sub report_validation { $errors->{name} = sprintf( _('Names are limited to %d characters in length.'), 50 ); } - if ( length( $report->user->phone ) > 20 ) { + if ( $report->user->phone && length( $report->user->phone ) > 20 ) { $errors->{phone} = sprintf( _('Phone numbers are limited to %s characters in length.'), 20 ); } diff --git a/t/cobrand/westminster.t b/t/cobrand/westminster.t index 84def0917..54de5a160 100644 --- a/t/cobrand/westminster.t +++ b/t/cobrand/westminster.t @@ -79,7 +79,7 @@ FixMyStreet::override_config { $mech->content_contains($comment3->text); }; - subtest 'Reports don’t show updates from fixmystreet.com cobrand' => sub { + subtest "Reports don't show updates from fixmystreet.com cobrand" => sub { $mech->get_ok('/report/' . $report->id); $mech->content_lacks($comment2->text); }; |