Bug 29107 - item_type should be item_type_id on item response object
Summary: item_type should be item_type_id on item response object
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on: 16825
Blocks: 29108
  Show dependency treegraph
 
Reported: 2021-09-24 11:26 UTC by Tomás Cohen Arazi
Modified: 2021-10-29 16:20 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.11.00


Attachments
Bug 29107: Rename item_type => item_type_id (2.06 KB, patch)
2021-09-24 11:41 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29107: Rename item_type => item_type_id (2.07 KB, patch)
2021-09-24 14:20 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2021-09-24 11:26:34 UTC
This is what we've been doing, and not fixing it prevents us from embedding the actual item_type object if we required it.
Comment 1 Tomás Cohen Arazi 2021-09-24 11:41:14 UTC
Created attachment 125236 [details] [review]
Bug 29107: Rename item_type => item_type_id

This simple change renames the attribute in the item object API
representation.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/items.t
=> SUCCESS: Tests pass
2. Run:
   $ git grep 'api/v1/items'
=> SUCCESS: The items routes are not (yet) used in Koha
3. Run:
   $ cd koha-tmpl
   $ git grep --name-only '"embed"'
=> SUCCESS: Only two templates are using embed.
4. Check:
   - register.tt uses it to embed the manager, good
   - parcel.tt uses it to embed items. Alert.
=> SUCCESS: parcel.tt only uses a count on items. No item_type involved.
5. Sign off

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

https://bugs.koha-community.org/show_bug.cgi?id=29105
Comment 2 Martin Renvoize 2021-09-24 14:20:25 UTC
Created attachment 125253 [details] [review]
Bug 29107: Rename item_type => item_type_id

This simple change renames the attribute in the item object API
representation.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/items.t
=> SUCCESS: Tests pass
2. Run:
   $ git grep 'api/v1/items'
=> SUCCESS: The items routes are not (yet) used in Koha
3. Run:
   $ cd koha-tmpl
   $ git grep --name-only '"embed"'
=> SUCCESS: Only two templates are using embed.
4. Check:
   - register.tt uses it to embed the manager, good
   - parcel.tt uses it to embed items. Alert.
=> SUCCESS: parcel.tt only uses a count on items. No item_type involved.
5. Sign off

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2021-09-30 10:25:13 UTC
Trivial string fix.. going straight for PQA
Comment 4 Jonathan Druart 2021-10-28 15:45:04 UTC
Pushed to master for 21.11, thanks to everybody involved!