Bug 41695

Summary: Suggestion->refuser returns the manager
Product: Koha Reporter: Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski>
Component: AcquisitionsAssignee: Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 39721    
Bug Blocks:    
Attachments: Bug 41695: Unit tests
Bug 41695: Fix rejecter in suggestion.pm
Bug 41695: Fix rejecter in suggestion.pm

Description Baptiste Wojtkowski (bwoj) 2026-01-23 13:34:45 UTC
I have no clue on any functional implication of this, but following code looks wrong in Koha/Suggestion.pm

>sub rejecter {
>    my ($self) = @_;
>    my $rejecter_rs = $self->_result->managedby;
>    return unless $rejecter_rs;
>    return Koha::Patron->_new_from_dbic($rejecter_rs);
>}

The rejecter returned is the "managedby" property in the db, however there is a rejectedby property in the database
Comment 1 Baptiste Wojtkowski (bwoj) 2026-01-23 13:39:54 UTC
Created attachment 191929 [details] [review]
Bug 41695: Unit tests
Comment 2 Baptiste Wojtkowski (bwoj) 2026-01-23 13:39:56 UTC
Created attachment 191930 [details] [review]
Bug 41695: Fix rejecter in suggestion.pm
Comment 3 Baptiste Wojtkowski (bwoj) 2026-01-23 13:47:15 UTC
Created attachment 191936 [details] [review]
Bug 41695: Fix rejecter in suggestion.pm

TEST PLAN:
1 - Apply tests patch
2 - Run 'prove t/db_dependent/Koha/Suggestions.t' -> it fails on
rejecter
3 - Apply this patch
4 - Run 'prove t/db_dependent/Koha/Suggestions.t' -> it works

Note: this patch also provide tests for remaining accessors in the
subtest