Bugzilla – Attachment 176948 Details for
Bug 38679
GET /deleted/biblios missing some mappings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38679: Add attribute mappings Koha::Old::Biblioitem
Bug-38679-Add-attribute-mappings-KohaOldBiblioitem.patch (text/plain), 3.22 KB, created by
Jonathan Druart
on 2025-01-23 11:33:46 UTC
(
hide
)
Description:
Bug 38679: Add attribute mappings Koha::Old::Biblioitem
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-01-23 11:33:46 UTC
Size:
3.22 KB
patch
obsolete
>From 5dd0c7f3b52b26f9a4ac3d3ef9f9acda9df7f6ec Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 11 Dec 2024 15:45:00 -0300 >Subject: [PATCH] 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> >--- > Koha/Old/Biblioitem.pm | 48 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 48 insertions(+) > >diff --git a/Koha/Old/Biblioitem.pm b/Koha/Old/Biblioitem.pm >index 24f3a99d6df..5f947e97e71 100644 >--- a/Koha/Old/Biblioitem.pm >+++ b/Koha/Old/Biblioitem.pm >@@ -27,8 +27,56 @@ Koha::Old::Biblioitem - Koha Old::Biblioitem Object class > > =head2 Class methods > >+=head3 public_read_list >+ >+This method returns the list of publicly readable database fields for both API and UI output purposes >+ >+=cut >+ >+sub public_read_list { >+ return [ >+ 'volume', 'number', 'isbn', >+ 'issn', 'ean', 'publicationyear', >+ 'publishercode', 'volumedate', 'volumedesc', >+ 'collectiontitle', 'collectionissn', 'collectionvolume', >+ 'editionstatement', 'editionresponsibility', 'pages', >+ 'place', 'lccn', 'url', >+ 'cn_source', 'cn_class', 'cn_item', >+ 'cn_suffix', 'cn_sort', 'agerestriction', >+ 'totalissues' >+ ]; >+} >+ >+=head3 to_api_mapping >+ >+This method returns the mapping for representing a Koha::Biblioitem object >+on the API. >+ > =cut > >+sub to_api_mapping { >+ return { >+ agerestriction => 'age_restriction', >+ biblionumber => 'biblio_id', >+ biblioitemnumber => undef, # meaningless >+ collectionissn => 'collection_issn', >+ collectiontitle => 'collection_title', >+ collectionvolume => 'collection_volume', >+ editionresponsibility => undef, # obsolete, not mapped >+ editionstatement => 'edition_statement', >+ illus => 'illustrations', >+ itemtype => 'item_type', >+ lccn => 'lc_control_number', >+ place => 'publication_place', >+ publicationyear => 'publication_year', >+ publishercode => 'publisher', >+ size => 'material_size', >+ totalissues => 'serial_total_issues', >+ volumedate => 'volume_date', >+ volumedesc => 'volume_description', >+ }; >+} >+ > =head2 Internal methods > > =head3 _type >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38679
:
175378
|
176302
|
176881
|
176882
| 176948 |
176949