Bugzilla – Attachment 175378 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.09 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-12-11 18:47:52 UTC
(
hide
)
Description:
Bug 38679: Add attribute mappings Koha::Old::Biblioitem
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-12-11 18:47:52 UTC
Size:
3.09 KB
patch
obsolete
>From b212c83b6143115ae6d2ec78a0acb323377d3aaa 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> >--- > Koha/Old/Biblioitem.pm | 48 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 48 insertions(+) > >diff --git a/Koha/Old/Biblioitem.pm b/Koha/Old/Biblioitem.pm >index 24f3a99d6df..fa9b107ce14 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', 'columedesc', >+ '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.47.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