Bug 17992

Summary: REST api: Cities controller should not use ->unblessed
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: minor    
Priority: P5 - low CC: josef.moravec, katrin.fischer, kyle, m.de.rooy, matthias.meusburger
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17932    
Bug Blocks:    
Attachments: Bug 17992: REST api: Remove the use of ->unblessed from Cities controller
Bug 17992: REST api: Remove the use of ->unblessed from Cities controller
Bug 17992: REST api: Remove the use of ->unblessed from Cities controller

Description Tomás Cohen Arazi 2017-01-25 12:35:10 UTC
As bug 17932 introduced the TO_JSON method there's no need to call ->unblessed anymore. As this is a reference implementation, I fix it to the new coding style.
Comment 1 Tomás Cohen Arazi 2017-01-25 12:48:19 UTC
Created attachment 59548 [details] [review]
Bug 17992: REST api: Remove the use of ->unblessed from Cities controller

As bug 17932 adds TO_JSON to Koha::Object(s), there's no need for using
it. Also, as this is a reference implementation for developers to copy
and paste it is sensible to make this change even when this is not
causing any bug.

To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/db_dependent/api/v1/cities.t
=> SUCCESS: Tests still pass!
- Sign off :-D
Comment 2 Matthias Meusburger 2017-03-01 10:24:40 UTC
Created attachment 60750 [details] [review]
Bug 17992: REST api: Remove the use of ->unblessed from Cities controller

As bug 17932 adds TO_JSON to Koha::Object(s), there's no need for using
it. Also, as this is a reference implementation for developers to copy
and paste it is sensible to make this change even when this is not
causing any bug.

To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/db_dependent/api/v1/cities.t
=> SUCCESS: Tests still pass!
- Sign off :-D

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Comment 3 Marcel de Rooy 2017-03-01 12:11:26 UTC
Created attachment 60753 [details] [review]
Bug 17992: REST api: Remove the use of ->unblessed from Cities controller

As bug 17932 adds TO_JSON to Koha::Object(s), there's no need for using
it. Also, as this is a reference implementation for developers to copy
and paste it is sensible to make this change even when this is not
causing any bug.

To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/db_dependent/api/v1/cities.t
=> SUCCESS: Tests still pass!
- Sign off :-D

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Kyle M Hall 2017-03-03 16:57:53 UTC
Pushed to master for 17.05, thanks Tomas!
Comment 5 Katrin Fischer 2017-03-12 22:28:16 UTC
Depends on bug 17932 which is not in 16.11.x.