Bug 22144 - Add method metadata() to Koha::Biblio
Summary: Add method metadata() to Koha::Biblio
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Kyle M Hall
QA Contact: Josef Moravec
URL:
Keywords:
Depends on: 22155 22194
Blocks: 23425
  Show dependency treegraph
 
Reported: 2019-01-16 19:23 UTC by Kyle M Hall
Modified: 2020-06-04 20:32 UTC (History)
6 users (show)

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


Attachments
Bug 22144: Add method marc() to Koha::Biblio (3.30 KB, patch)
2019-01-16 19:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 22144: Add method marc() to Koha::Biblio (3.35 KB, patch)
2019-01-16 21:02 UTC, terahuitunua
Details | Diff | Splinter Review
Bug 22144: Add method marc() to Koha::Biblio (3.35 KB, patch)
2019-01-17 12:01 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 22144 [QA Followup]: Move Koha::Biblio::marc to Koha::Biblio::Metadata::record (3.77 KB, patch)
2019-01-18 15:53 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 22144: Add method metadata() to Koha::Biblio (4.62 KB, patch)
2019-01-24 11:12 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22144: (QA follow-up) Prepare the ground for other formats (5.84 KB, patch)
2019-01-24 11:12 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22144: Add method metadata() to Koha::Biblio (4.69 KB, patch)
2019-01-24 11:31 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 22144: (QA follow-up) Prepare the ground for other formats (5.91 KB, patch)
2019-01-24 11:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 22144: Add method metadata() to Koha::Biblio (4.74 KB, patch)
2019-01-24 13:02 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 22144: (QA follow-up) Prepare the ground for other formats (5.96 KB, patch)
2019-01-24 13:03 UTC, Josef Moravec
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2019-01-16 19:23:04 UTC
It would be very convenient to be able to retrieve a bib's MARC::Record object directly from biblio object. This would be very useful for Template Toolkit syntax in slips and notices where a library would like to use arbitrary MARC fields that aren't stored in the database.
Comment 1 Kyle M Hall 2019-01-16 19:27:30 UTC
Created attachment 84076 [details] [review]
Bug 22144: Add method marc() to Koha::Biblio

It would be very convenient to be able to retrieve a bib's MARC::Record object directly from biblio object. This would be very useful for Template Toolkit syntax in slips and notices where a library would like to use arbitrary MARC fields that aren't stored in the database.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Biblio.t
Comment 2 terahuitunua 2019-01-16 21:02:30 UTC
Created attachment 84093 [details] [review]
Bug 22144: Add method marc() to Koha::Biblio

It would be very convenient to be able to retrieve a bib's MARC::Record object directly from biblio object. This would be very useful for Template Toolkit syntax in slips and notices where a library would like to use arbitrary MARC fields that aren't stored in the database.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Biblio.t

Signed-off-by: Te Rahui Tunua <terahuitunua@catalyst.net.nz>
Comment 3 Kyle M Hall 2019-01-17 12:01:59 UTC
Created attachment 84137 [details] [review]
Bug 22144: Add method marc() to Koha::Biblio

It would be very convenient to be able to retrieve a bib's MARC::Record object directly from biblio object. This would be very useful for Template Toolkit syntax in slips and notices where a library would like to use arbitrary MARC fields that aren't stored in the database.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Biblio.t

Signed-off-by: Te Rahui Tunua <terahuitunua@catalyst.net.nz>
Comment 4 Tomás Cohen Arazi 2019-01-17 15:07:05 UTC
While we really need to move things into Koha::Biblio, we might better keep in mind that we now have biblio_metadata, which isn't actually tied to a specific serialization format and data schema.
I'm not implying we should move C4 code into Koha::Biblio to have something like this (we should, in a mid term) but at least we should leave room for a more general approach: at least return a metadata object, in the lines of Koha::MetadataRecord which "can" be a MARC record.

My two cents. I will think about it, because this would benefit the API develpment too.
Comment 5 Kyle M Hall 2019-01-18 15:53:17 UTC
Created attachment 84205 [details] [review]
Bug 22144 [QA Followup]: Move Koha::Biblio::marc to Koha::Biblio::Metadata::record
Comment 6 Tomás Cohen Arazi 2019-01-24 11:12:08 UTC
Created attachment 84343 [details] [review]
Bug 22144: Add method metadata() to Koha::Biblio

It would be very convenient to be able to retrieve a bib's attached metadata objects directly from the biblio object. This would be very useful for Template Toolkit syntax in slips and notices where a library would like to use arbitrary metadata fields that aren't stored in the database.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Biblio.t

Signed-off-by: Te Rahui Tunua <terahuitunua@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Tomás Cohen Arazi 2019-01-24 11:12:13 UTC
Created attachment 84344 [details] [review]
Bug 22144: (QA follow-up) Prepare the ground for other formats

This patch refactors the original implementation so it is ready for
supporting other formats. It also adds some error handling.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Biblio/Metadata.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Kyle M Hall 2019-01-24 11:31:46 UTC
Created attachment 84345 [details] [review]
Bug 22144: Add method metadata() to Koha::Biblio

It would be very convenient to be able to retrieve a bib's attached metadata objects directly from the biblio object. This would be very useful for Template Toolkit syntax in slips and notices where a library would like to use arbitrary metadata fields that aren't stored in the database.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Biblio.t

Signed-off-by: Te Rahui Tunua <terahuitunua@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Kyle M Hall 2019-01-24 11:32:03 UTC
Created attachment 84346 [details] [review]
Bug 22144: (QA follow-up) Prepare the ground for other formats

This patch refactors the original implementation so it is ready for
supporting other formats. It also adds some error handling.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Biblio/Metadata.t
=> SUCCESS: Tests pass!
- Sign off :-D

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Josef Moravec 2019-01-24 13:02:57 UTC
Created attachment 84350 [details] [review]
Bug 22144: Add method metadata() to Koha::Biblio

It would be very convenient to be able to retrieve a bib's attached metadata objects directly from the biblio object. This would be very useful for Template Toolkit syntax in slips and notices where a library would like to use arbitrary metadata fields that aren't stored in the database.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Biblio.t

Signed-off-by: Te Rahui Tunua <terahuitunua@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 11 Josef Moravec 2019-01-24 13:03:01 UTC
Created attachment 84351 [details] [review]
Bug 22144: (QA follow-up) Prepare the ground for other formats

This patch refactors the original implementation so it is ready for
supporting other formats. It also adds some error handling.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Biblio/Metadata.t
=> SUCCESS: Tests pass!
- Sign off :-D

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 12 Nick Clemens 2019-01-31 13:38:29 UTC
Awesome work all!

Pushed to master for 19.05
Comment 13 Martin Renvoize 2019-02-01 15:36:34 UTC
Enhancement, will not be backported to 18.11.x series.