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.
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
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>
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>
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.
Created attachment 84205 [details] [review] Bug 22144 [QA Followup]: Move Koha::Biblio::marc to Koha::Biblio::Metadata::record
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>
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>
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>
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>
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>
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>
Awesome work all! Pushed to master for 19.05
Enhancement, will not be backported to 18.11.x series.