From 1db6d9c6655bb816b5a508766cc3c993285d60d4 Mon Sep 17 00:00:00 2001 From: Mohammad Sajid Anwar Date: Sat, 3 May 2025 15:38:10 +0100 Subject: [PATCH] Proposed patch for issue 3235 Explicitly setting size to 500 to override the default size 250. https://metacpan.org/author/SYP --- lib/MetaCPAN/Web/Controller/Author.pm | 6 +++++- lib/MetaCPAN/Web/Model/API/Favorite.pm | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/MetaCPAN/Web/Controller/Author.pm b/lib/MetaCPAN/Web/Controller/Author.pm index 480d6c2d06..535e779903 100644 --- a/lib/MetaCPAN/Web/Controller/Author.pm +++ b/lib/MetaCPAN/Web/Controller/Author.pm @@ -55,7 +55,11 @@ sub index : Chained('root') PathPart('') Args(0) { @{ $releases->{releases} }; $c->res->last_modified($date) if $date; - my $faves = $c->model('API::Favorite')->by_user( $author->{user} )->get; + # Issue: https://github.com/metacpan/metacpan-web/issues/3235 + # Explicitly setting size to 500 to override the default size 250. + my $size = 500; + my $faves + = $c->model('API::Favorite')->by_user( $author->{user}, $size )->get; my $profiles = $c->model('API::Author')->profile_data; diff --git a/lib/MetaCPAN/Web/Model/API/Favorite.pm b/lib/MetaCPAN/Web/Model/API/Favorite.pm index 0a0d12fcca..5d02e0a640 100644 --- a/lib/MetaCPAN/Web/Model/API/Favorite.pm +++ b/lib/MetaCPAN/Web/Model/API/Favorite.pm @@ -24,8 +24,8 @@ sub by_user { $size ||= 250; return Future->done( [] ) if !defined $user; - return $self->request( "/favorite/by_user/$user", { size => $size } ) - ->transform( + return $self->request( "/favorite/by_user/$user", undef, + { size => $size } )->transform( done => sub { my $data = shift; return [] unless exists $data->{favorites};