| Summary: | Move Koha::Biblio->get_marc_* to Koha::Biblio::Metadata | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> | 
| Component: | Architecture, internals, and plumbing | Assignee: | Bugs List <koha-bugs> | 
| Status: | NEW --- | QA Contact: | Testopia <testopia> | 
| Severity: | enhancement | ||
| Priority: | P5 - low | CC: | dcook, fridolin.somers, martin.renvoize | 
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29441 | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Crowdfunding goal: | 0 | 
| Patch complexity: | --- | Documentation contact: | |
| Documentation submission: | Text to go in the release notes: | ||
| Version(s) released in: | Circulation function: | ||
| Bug Depends on: | 27266, 27268, 29871, 30744, 30918 | ||
| Bug Blocks: | |||
| I see Bug 27268 kept marcflavour has param : my $marcflavour = $params->{marcflavour}; But other calls fetch syspref value : get_marc_host, get_marc_authors ... We should be consistent. Any reason to keep marcflavour has param ? (In reply to Fridolin Somers from comment #1) > I see Bug 27268 kept marcflavour has param : > my $marcflavour = $params->{marcflavour}; > > But other calls fetch syspref value : > get_marc_host, get_marc_authors ... > > We should be consistent. > > Any reason to keep marcflavour has param ? I wouldn't keep it (In reply to Tomás Cohen Arazi from comment #2) > (In reply to Fridolin Somers from comment #1) > > I see Bug 27268 kept marcflavour has param : > > my $marcflavour = $params->{marcflavour}; > > > > But other calls fetch syspref value : > > get_marc_host, get_marc_authors ... > > > > We should be consistent. > > > > Any reason to keep marcflavour has param ? > > I wouldn't keep it I don't even think it should consider the syspref. The syspref would've been considered when setting the 'schema' (In reply to Tomás Cohen Arazi from comment #3) > I don't even think it should consider the syspref. The syspref would've been > considered when setting the 'schema' Ah but the code of get_marc_*() often contains a "if UNIMARC else ..." because fields number are hardcoded (for example title on 200 in UNIMARC). Only when we will have a Dublin Core schema this will not be needed anymore ^^ (In reply to Fridolin Somers from comment #4) > (In reply to Tomás Cohen Arazi from comment #3) > > I don't even think it should consider the syspref. The syspref would've been > > considered when setting the 'schema' > > Ah but the code of get_marc_*() often contains a "if UNIMARC else ..." > because fields number are hardcoded (for example title on 200 in UNIMARC). > > Only when we will have a Dublin Core schema this will not be needed anymore > ^^ What if the biblio_metadata.schema had UNIMARC and the syspref MARC? I'd say biblio_metadata.schema would be the source for truth, same as with DublinCore. So we don't need to read the syspref in Koha::Biblio::Metadata->authors, we just check $self->schema and do the right thing (In reply to Tomás Cohen Arazi from comment #5) > > What if the biblio_metadata.schema had UNIMARC and the syspref MARC? > > I'd say biblio_metadata.schema would be the source for truth, same as with > DublinCore. So we don't need to read the syspref in > Koha::Biblio::Metadata->authors, we just check $self->schema and do the > right thing A sure, 100% agreed. We agreed to remove the marcflavour parameter in dev meeting https://wiki.koha-community.org/wiki/Development_IRC_meeting_5_January_2022 | 
When you look at the methods code, you notice - It is tied to the Koha::Biblio::Metadata->record - The code branches depending on information that is passed, that is already present at the Koha::Biblio::Metadata object/level (MARCFLAVOUR=schema, the record itself) There should still exist a Koha::Biblio->authors/notes method to retrieve this information at that level, but calling the metadata object methods. This way the caller could do: my $biblio = Koha::Biblios->find( $biblio_id, { prefetch => ['biblio_metadata'] } ); and even save some queries.