[Koha-bugs] [Bug 16330] REST API: add routes to add, update and delete patrons

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Dec 18 16:00:56 CET 2017


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

--- Comment #80 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
(In reply to Jonathan Druart from comment #78)
> Please double check there is something wrong: Koha::Patron->store does
> nothing, and ->_validate (private) is called from outside the module.

I agree, _validate doesn't prove that useful, so maybe we should get rid of it
at all.

> I guess it should be called, and then the expections caught from (at least)
> memberentry.
> 
> Same for Koha::Patron::Modification->store, I think the exception must be
> caught in our code.

This looked handy, but I actually removed the code that dealt with modification
requests on this endpoint. Would you agree we can just remove this from the
commit?

> And, first of all, _check_branchcode and _check_categorycode sound wrong: we
> have a FK on DB level and DBIx::Class will raise an error already if
> something is missing. Are we going to create these kind of check method for
> all the FK we have at DB level?

I agree with this assertion. I think ->store should just catch and parse the
DBIC exceptions and raise our own to have better control of the situation.

I don't agree we should catch the exceptions on this bug, as those exceptions
already raise (DBIC ones) and are currently uncatched. Would you accept that we
filed a new bug for better exception handling in controller scripts using
Koha::Patron->store?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list