From 1647d0ae62044bd1d493897b5980a92f5a2c613a Mon Sep 17 00:00:00 2001 From: Mohammad Sajid Anwar Date: Fri, 23 May 2025 18:49:20 +0100 Subject: [PATCH 1/2] Proposed patch for issue 3353 1) Remove author from contributors list 2) Use plural form only if more than one contributors --- lib/MetaCPAN/Web/Controller/Release.pm | 10 ++++++++++ root/inc/contributors.tx | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/MetaCPAN/Web/Controller/Release.pm b/lib/MetaCPAN/Web/Controller/Release.pm index 56c62a4314..93387e8920 100644 --- a/lib/MetaCPAN/Web/Controller/Release.pm +++ b/lib/MetaCPAN/Web/Controller/Release.pm @@ -63,6 +63,16 @@ sub view : Private { $c->detach( '/internal_error', $error ); } )->get; + ## Remove author from contributors list + my $author_name = $data->{author}->{name}; + my $contributors = []; + foreach my $contributor (@{$data->{contributors}}) { + if ($contributor->{name} !~ /\b$author_name\b/) { + push @$contributors, $contributor; + } + } + $data->{contributors} = $contributors; + my $release = $data->{release}; $c->browser_max_age('1h'); diff --git a/root/inc/contributors.tx b/root/inc/contributors.tx index 93178adb97..5c73556a42 100644 --- a/root/inc/contributors.tx +++ b/root/inc/contributors.tx @@ -1,7 +1,7 @@ %% if $contributors.size() {
- +
    From 480bfe1bd41a3b37eeb940f25fea69bf2086ce3f Mon Sep 17 00:00:00 2001 From: Mohammad Sajid Anwar Date: Fri, 23 May 2025 18:59:22 +0100 Subject: [PATCH 2/2] perltidy the change as requested. --- lib/MetaCPAN/Web/Controller/Release.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/MetaCPAN/Web/Controller/Release.pm b/lib/MetaCPAN/Web/Controller/Release.pm index 93387e8920..4d3448b641 100644 --- a/lib/MetaCPAN/Web/Controller/Release.pm +++ b/lib/MetaCPAN/Web/Controller/Release.pm @@ -66,8 +66,8 @@ sub view : Private { ## Remove author from contributors list my $author_name = $data->{author}->{name}; my $contributors = []; - foreach my $contributor (@{$data->{contributors}}) { - if ($contributor->{name} !~ /\b$author_name\b/) { + foreach my $contributor ( @{ $data->{contributors} } ) { + if ( $contributor->{name} !~ /\b$author_name\b/ ) { push @$contributors, $contributor; } }