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

--- Comment #16 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 203180
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203180&action=edit
Bug 42311: (QA follow-up) Standardise CRUD controllers on new_from_api

Two of the four calendar CRUD controllers previously used the
$library->calendar->add_* accessor path on POST, while the other two
(WeeklyClosures, RepeatingClosures) used Koha::Calendar::*->new_from_api.
The accessor path skips new_from_api and therefore skips the API-name to
column-name translation: the two styles happen to behave identically
today because the spec's field names match column names, but any future
divergence would silently break only the two accessor-based endpoints.

Switch SingleClosures and ClosureExceptions add() to the new_from_api
pattern so all four controllers follow the same Koha REST convention.

While here, add the missing "use Scalar::Util qw( blessed );" to every
controller in the directory: each was calling blessed() in its catch
block without importing it.

Test plan:
1. prove t/db_dependent/api/v1/libraries_calendar.t
2. POST /api/v1/libraries/{id}/calendar/single_closures still creates
   a closure; duplicate POST returns 409
3. POST /api/v1/libraries/{id}/calendar/closure_exceptions same

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to