Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lib/MetaCPAN/Web/Model/ReleaseInfo.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ use MetaCPAN::Web::Types qw( HashRef Object );
use URI;
use URI::Escape qw(uri_escape uri_unescape);
use URI::QueryParam; # Add methods to URI.
use Importer 'MetaCPAN::Web::Elasticsearch::Adapter' =>
qw/ single_valued_arrayref_to_scalar /;

sub ACCEPT_CONTEXT {
my ( $class, $c, $args ) = @_;
Expand Down Expand Up @@ -63,7 +65,9 @@ sub summary_hash {
# massage the x_contributors field into what we want
sub groom_contributors {
my ($self) = @_;
my ( $release, $author ) = ( $self->release, $self->author );
my ( $release, $author )
= ( $self->release,
single_valued_arrayref_to_scalar( $self->author ) );

my $contribs = $release->{metadata}{x_contributors} || [];
my $authors = $release->{metadata}{author} || [];
Expand All @@ -82,11 +86,8 @@ sub groom_contributors {
$authors = [ grep { $_ ne 'unknown' } @$authors ];

my $author_info = {
email => [
lc "$release->{author}\@cpan.org",
@{ $author->{email} || [] },
],
name => $author->{name},
email => [ lc "$release->{author}\@cpan.org", $author->{email} ],
name => $author->{name},
};
my %seen = map { $_ => $author_info }
( @{ $author_info->{email} }, $author_info->{name}, );
Expand Down
3 changes: 2 additions & 1 deletion t/controller/shared/release-info.t
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ test_psgi app, sub {
module => 'LWP::UserAgent',
release => 'libwww-perl',
repository => 0,
home_page => 0
home_page => 0,
issues => 'https://github.com/libwww-perl/libwww-perl/issues',
},

# no optional tests
Expand Down