diff --git a/lib/MetaCPAN/Web/Model/API/Contributors.pm b/lib/MetaCPAN/Web/Model/API/Contributors.pm index 30f7cd1cc1..65c4ba9151 100644 --- a/lib/MetaCPAN/Web/Model/API/Contributors.pm +++ b/lib/MetaCPAN/Web/Model/API/Contributors.pm @@ -27,6 +27,9 @@ sub get { my ( $self, $author, $release ) = @_; my $cv = $self->cv; + # If there's no release, we'll just redirect + $release //= {}; + $self->request( '/release/contributors/' . $author . '/' . $release, ) ->cb( sub { diff --git a/lib/MetaCPAN/Web/View/HTML.pm b/lib/MetaCPAN/Web/View/HTML.pm index 342e63085b..30fbf24166 100644 --- a/lib/MetaCPAN/Web/View/HTML.pm +++ b/lib/MetaCPAN/Web/View/HTML.pm @@ -204,6 +204,7 @@ Template::Alloy->define_vmethod( my ( $text, $count ) = @_; # Send args individually since the sub has a prototype. + $count //= 0; return Text::Pluralize::pluralize( $text, $count ); }, ); diff --git a/t/controller/feed.t b/t/controller/feed.t index 58d6c634e9..98d3051d50 100644 --- a/t/controller/feed.t +++ b/t/controller/feed.t @@ -106,7 +106,7 @@ test_psgi app, sub { test_redirect( $cb, 'oalders' ); - subtest '404' => sub { + subtest 'author 404' => sub { my $res = $cb->( GET '/feed/author/XXX343wi^^^' ); is( $res->code, 404, '404 when author does not exist' ); };