Bug 38679

Summary: GET /deleted/biblios missing some mappings
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: REST APIAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: Pushed to stable --- QA Contact: Jonathan Druart <jonathan.druart>
Severity: normal    
Priority: P5 - low CC: m.de.rooy, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00,24.11.04
Circulation function:
Bug Depends on: 33960    
Bug Blocks:    
Attachments: Bug 38679: Add attribute mappings Koha::Old::Biblioitem
Bug 38679: Add attribute mappings Koha::Old::Biblioitem
Bug 38679: Add attribute mappings Koha::Old::Biblioitem
Bug 38679: (follow-up) Fix old typos in column names
Bug 38679: Add attribute mappings Koha::Old::Biblioitem
Bug 38679: (follow-up) Fix old typos in column names

Description Tomás Cohen Arazi (tcohen) 2024-12-11 18:43:37 UTC
When we implemented the `GET /deleted/biblios` endpoint, we missing the mapping for the `biblioitems` table attributes.

To reproduce:
1. Pick a sample record ID
2. Fetch is using the API with your favourite tool:
   GET /api/v1/biblios/<the ID>
   Accept: application/json
3. Save the output for later
4. Delete the record
5. Fetch the deleted biblio using the API:
   GET /api/v1/deleted/biblios/<the ID>
   Accept: application/json
6. Compare the results
=> FAIL: Attributes like `volumedate` are not mapped!
Comment 1 Tomás Cohen Arazi (tcohen) 2024-12-11 18:47:52 UTC
Created attachment 175378 [details] [review]
Bug 38679: Add attribute mappings Koha::Old::Biblioitem

This trivial patch replicates the mappings in Koha::Biblioitem.

To test:
1. Pick a sample record ID
2. Fetch is using the API with your favourite tool:
   GET /api/v1/biblios/<the ID>
   Accept: application/json
3. Save the output for later
4. Delete the record
5. Fetch the deleted biblio using the API:
   GET /api/v1/deleted/biblios/<the ID>
   Accept: application/json
6. Compare the results
=> FAIL: Attributes like `volumedate` are not mapped!
7. Apply this patch
8. Repeat 5
=> SUCCESS: Attributes are mapped!
9. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Leo Stoyanov 2025-01-09 20:07:40 UTC
Created attachment 176302 [details] [review]
Bug 38679: Add attribute mappings Koha::Old::Biblioitem

This trivial patch replicates the mappings in Koha::Biblioitem.

To test:
1. Pick a sample record ID
2. Fetch is using the API with your favourite tool:
   GET /api/v1/biblios/<the ID>
   Accept: application/json
3. Save the output for later
4. Delete the record
5. Fetch the deleted biblio using the API:
   GET /api/v1/deleted/biblios/<the ID>
   Accept: application/json
6. Compare the results
=> FAIL: Attributes like `volumedate` are not mapped!
7. Apply this patch
8. Repeat 5
=> SUCCESS: Attributes are mapped!
9. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Leo Stoyanov <leo.stoyanov@bywatersolutions.com>
Comment 3 Marcel de Rooy 2025-01-10 09:12:26 UTC
Check field names again in public_read_list:
'columedesc' ?
'cn)item' ??

Looks like you had to run for the bus? :)
Comment 4 Tomás Cohen Arazi (tcohen) 2025-01-21 18:59:14 UTC
(In reply to Marcel de Rooy from comment #3)
> Check field names again in public_read_list:
> 'columedesc' ?
> 'cn)item' ??
> 
> Looks like you had to run for the bus? :)

LOL. I just copied and pasted from Koha/Biblioitem.pm

Will submit a fixed version.
Comment 5 Tomás Cohen Arazi (tcohen) 2025-01-21 19:05:07 UTC
Created attachment 176881 [details] [review]
Bug 38679: Add attribute mappings Koha::Old::Biblioitem

This trivial patch replicates the mappings in Koha::Biblioitem.

To test:
1. Pick a sample record ID
2. Fetch is using the API with your favourite tool:
   GET /api/v1/biblios/<the ID>
   Accept: application/json
3. Save the output for later
4. Delete the record
5. Fetch the deleted biblio using the API:
   GET /api/v1/deleted/biblios/<the ID>
   Accept: application/json
6. Compare the results
=> FAIL: Attributes like `volumedate` are not mapped!
7. Apply this patch
8. Repeat 5
=> SUCCESS: Attributes are mapped!
9. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Leo Stoyanov <leo.stoyanov@bywatersolutions.com>
Comment 6 Tomás Cohen Arazi (tcohen) 2025-01-21 19:05:09 UTC
Created attachment 176882 [details] [review]
Bug 38679: (follow-up) Fix old typos in column names

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Jonathan Druart 2025-01-23 11:33:46 UTC
Created attachment 176948 [details] [review]
Bug 38679: Add attribute mappings Koha::Old::Biblioitem

This trivial patch replicates the mappings in Koha::Biblioitem.

To test:
1. Pick a sample record ID
2. Fetch is using the API with your favourite tool:
   GET /api/v1/biblios/<the ID>
   Accept: application/json
3. Save the output for later
4. Delete the record
5. Fetch the deleted biblio using the API:
   GET /api/v1/deleted/biblios/<the ID>
   Accept: application/json
6. Compare the results
=> FAIL: Attributes like `volumedate` are not mapped!
7. Apply this patch
8. Repeat 5
=> SUCCESS: Attributes are mapped!
9. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Leo Stoyanov <leo.stoyanov@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2025-01-23 11:33:49 UTC
Created attachment 176949 [details] [review]
Bug 38679: (follow-up) Fix old typos in column names

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Katrin Fischer 2025-01-24 11:03:28 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 10 Paul Derscheid 2025-04-22 20:27:31 UTC
Nice work everyone!

Pushed to 24.11.x for 24.11.04