Bug 38679 - GET /deleted/biblios missing some mappings
Summary: GET /deleted/biblios missing some mappings
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on: 33960
Blocks:
  Show dependency treegraph
 
Reported: 2024-12-11 18:43 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2025-04-22 20:27 UTC (History)
2 users (show)

See Also:
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:


Attachments
Bug 38679: Add attribute mappings Koha::Old::Biblioitem (3.09 KB, patch)
2024-12-11 18:47 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 38679: Add attribute mappings Koha::Old::Biblioitem (3.15 KB, patch)
2025-01-09 20:07 UTC, Leo Stoyanov
Details | Diff | Splinter Review
Bug 38679: Add attribute mappings Koha::Old::Biblioitem (3.15 KB, patch)
2025-01-21 19:05 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 38679: (follow-up) Fix old typos in column names (1.24 KB, patch)
2025-01-21 19:05 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 38679: Add attribute mappings Koha::Old::Biblioitem (3.22 KB, patch)
2025-01-23 11:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38679: (follow-up) Fix old typos in column names (1.32 KB, patch)
2025-01-23 11:33 UTC, Jonathan Druart
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 (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