https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41237

Pedro Amorim <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         QA Contact|[email protected] |[email protected]
                   |y.org                       |

--- Comment #11 from Pedro Amorim <[email protected]> ---
(In reply to Marcel de Rooy from comment #9)
> OLD 
> If you had $patron, pass branchcode and cardnumber [WITHOUT using it btw] to
> backend_create.

backend_create does not use it directly, but delegates it to the specific
backend being utilized:

    my $args = {
        request => $self,
        other   => $params,
    };
    my $result = $self->_backend->create($args);

The backend itself will then make use of it. Take a look at
Koha/ILL/Backend/Standard::create for example, which then calls add_request
that then does use it to effectively insert the request in the database.

> In that sub always look for AddCont on library_id =>
> $params->{branchcode} so patron branch OR undefined (all libs).

This is correct, and highlights the problem exactly. It worked as intended for
that purpose, but had the side-effect of overwriting the existing
$params->{branchcode} which is the branchcode that is selected on the form and
may or may not be the logged in patron's branchcode.

> NEW
> Pass cardnumber but do NO LONGER pass branchcode.

branchcode is still passed, as was before. It's in $params->{branchcode}, but
now is the one submitted in the form by the user, not being overwritten.

> ONLY look for AddCont with library_id if you got patron->branchcode via
> cardnumber. So you never look at library_id undefined (all libs); instead
> you accept copyright clearance from any branch when there is no patron.

I understand that the code reads as such, but the way
AdditionalContents->search_for_display works is that it sets the search on
library_id = undef if the parameter is omited. I believe this behavior was
introduced in bug 29332.
Additionally, this potential regression would be caught by the tests written in
this patchset, one way to prove it is by reverting the change from bug 29332
and running t/db_dependent/Koha/ILL/Requests.t (with patches applied - QA
followup). It'll cause the tests to fail.

> QA COMMENT
> It seems odd to look up cardnumber in create_backend if you can pass $patron
> from the caller.

Agreed, follow-up patch submitted.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to