Bug 41695 - Suggestion->refuser returns the manager
Summary: Suggestion->refuser returns the manager
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Baptiste Wojtkowski (bwoj)
QA Contact: Testopia
URL:
Keywords:
Depends on: 39721
Blocks:
  Show dependency treegraph
 
Reported: 2026-01-23 13:34 UTC by Baptiste Wojtkowski (bwoj)
Modified: 2026-01-23 13:48 UTC (History)
1 user (show)

See Also:
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:


Attachments
Bug 41695: Unit tests (2.09 KB, patch)
2026-01-23 13:39 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 41695: Fix rejecter in suggestion.pm (787 bytes, patch)
2026-01-23 13:39 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 41695: Fix rejecter in suggestion.pm (1.03 KB, patch)
2026-01-23 13:47 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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