[Bug 30813] New: Refactor TransformMarcToKoha to remove TransformMarcToKohaOneField
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Bug ID: 30813 Summary: Refactor TransformMarcToKoha to remove TransformMarcToKohaOneField Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org While testing bug 30789 it was found that passing the already retrieved marc subfield structure into TransformMarckToKohaOneField increased performance by ~20% This seemed odd as the routine is already retrieving from cache unsafe Rather than pass around this shared variable, it seems to make sense to allow TransformMarcToKoha to take a list of fields to process, rather than have a seperate routine that must be called -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |30789 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30789 [Bug 30789] Improve performance of AddBiblio -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 135232 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135232&action=edit Bug 30813: Update TransformMarcToKoha to accept a hashref This patch updates all the calls to pass a hasref rather than an array It also removes the no longer used framework parameter To test: prove -v t/Biblio.t t/db_dependent/Biblio/TransformMarcToKoha.t -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #2 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 135233 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135233&action=edit Bug 30813: Adjust TransformMarcToKoha to take kohafields parameter This adjusts the routine to accept an arrayref of koha fields to process To test: prove -v t/db_dependent/Biblio/TransformMarcToKoha.t t/Biblio.t -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 135234 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135234&action=edit Bug 30813: Remove TransformMarcToKohaOneField To test: 1 - prove -v t/db_dependent/Biblio/TransformMarcToKoha.t t/db_dependent/Breeding.t 2 - Test Z3950 search in advanced catalog editor -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 135235 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135235&action=edit Bug 30813: Remove Koha::MetadataRecord::getKohaField This was essentially a wrapper around TransformKohaToMarcOneField After changing and updating, it seems easier not to create the intermediary object and to just transform the data -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135232|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 135239 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135239&action=edit Bug 30813: Update TransformMarcToKoha to accept a hashref This patch updates all the calls to pass a hasref rather than an array It also removes the no longer used framework parameter To test: prove -v t/Biblio.t t/db_dependent/Biblio/TransformMarcToKoha.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135233|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 135240 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135240&action=edit Bug 30813: Adjust TransformMarcToKoha to take kohafields parameter This adjusts the routine to accept an arrayref of koha fields to process To test: prove -v t/db_dependent/Biblio/TransformMarcToKoha.t t/Biblio.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135234|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 135241 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135241&action=edit Bug 30813: Remove TransformMarcToKohaOneField To test: 1 - prove -v t/db_dependent/Biblio/TransformMarcToKoha.t t/db_dependent/Breeding.t 2 - Test Z3950 search in advanced catalog editor Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135235|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 135242 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135242&action=edit Bug 30813: Remove Koha::MetadataRecord::getKohaField This was essentially a wrapper around TransformKohaToMarcOneField After changing and updating, it seems easier not to create the intermediary object and to just transform the data Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |martin.renvoize@ptfs-europe | |.com --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This works great and serves as another nice cleanup. QA script is happy, all unit tests for biblios and items are passing great. Signing off. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #10 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 135243 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135243&action=edit Bug 30813: (follow-up) ImportBatch updates Missed these in the original commits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |30824 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30824 [Bug 30824] Improve performance of BatchCommitItems -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135239|0 |1 is obsolete| | --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 135302 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135302&action=edit Bug 30813: Update TransformMarcToKoha to accept a hashref This patch updates all the calls to pass a hasref rather than an array It also removes the no longer used framework parameter To test: prove -v t/Biblio.t t/db_dependent/Biblio/TransformMarcToKoha.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135240|0 |1 is obsolete| | --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 135303 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135303&action=edit Bug 30813: Adjust TransformMarcToKoha to take kohafields parameter This adjusts the routine to accept an arrayref of koha fields to process To test: prove -v t/db_dependent/Biblio/TransformMarcToKoha.t t/Biblio.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135241|0 |1 is obsolete| | --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 135304 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135304&action=edit Bug 30813: Remove TransformMarcToKohaOneField To test: 1 - prove -v t/db_dependent/Biblio/TransformMarcToKoha.t t/db_dependent/Breeding.t 2 - Test Z3950 search in advanced catalog editor Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135242|0 |1 is obsolete| | --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 135305 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135305&action=edit Bug 30813: Remove Koha::MetadataRecord::getKohaField This was essentially a wrapper around TransformKohaToMarcOneField After changing and updating, it seems easier not to create the intermediary object and to just transform the data Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135243|0 |1 is obsolete| | --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 135306 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135306&action=edit Bug 30813: (follow-up) ImportBatch updates Missed these in the original commits Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |joonas.kylmala@iki.fi --- Comment #16 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- If you go to
/cgi-bin/koha/cataloguing/addbooks.pl
and perform a search using "New from Z39.50" you get:
Undefined subroutine &C4::Breeding::TransformMarcToKoha called at /kohadevbox/koha/C4/Breeding.pm line 311
to reproduce the error in the search pop-up put as the Title "aa". If you fix the missing import then the search results are still empty however (they should not be empty for this keyword), so there is a bit more to fix this, I will leave it to the author of the patch set. - Koha/MetaSearcher.pm doesn't import C4::Biblio - Koha/MetadataRecord.pm imports now C4::Biblio unnecessarily -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #17 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 135371 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135371&action=edit Bug 30813: (follow-up) Correct C4::Breeding call This patch changes the call to use the fully qualified name and adds import to C4::Breeding, Koha::MetaSearcher, and removes import from Koha::MetadataRecord Additionally it replaces missing fields from the update to using TransformMarcToKoha Lastly, it reduces the fields used when saving the bredding record to the reservoir -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |joonas.kylmala@iki.fi |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135302|0 |1 is obsolete| | Attachment #135303|0 |1 is obsolete| | Attachment #135304|0 |1 is obsolete| | Attachment #135305|0 |1 is obsolete| | Attachment #135306|0 |1 is obsolete| | Attachment #135371|0 |1 is obsolete| | --- Comment #18 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 135374 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135374&action=edit Bug 30813: Update TransformMarcToKoha to accept a hashref This patch updates all the calls to pass a hasref rather than an array It also removes the no longer used framework parameter To test: prove -v t/Biblio.t t/db_dependent/Biblio/TransformMarcToKoha.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #19 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 135375 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135375&action=edit Bug 30813: Adjust TransformMarcToKoha to take kohafields parameter This adjusts the routine to accept an arrayref of koha fields to process To test: prove -v t/db_dependent/Biblio/TransformMarcToKoha.t t/Biblio.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #20 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 135376 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135376&action=edit Bug 30813: Remove TransformMarcToKohaOneField To test: 1 - prove -v t/db_dependent/Biblio/TransformMarcToKoha.t t/db_dependent/Breeding.t 2 - Test Z3950 search in advanced catalog editor Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #21 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 135377 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135377&action=edit Bug 30813: Remove Koha::MetadataRecord::getKohaField This was essentially a wrapper around TransformKohaToMarcOneField After changing and updating, it seems easier not to create the intermediary object and to just transform the data Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #22 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 135378 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135378&action=edit Bug 30813: (follow-up) ImportBatch updates Missed these in the original commits Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #23 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 135379 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135379&action=edit Bug 30813: (follow-up) Correct C4::Breeding call This patch changes the call to use the fully qualified name and adds import to C4::Breeding, Koha::MetaSearcher, and removes import from Koha::MetadataRecord Additionally it replaces missing fields from the update to using TransformMarcToKoha Lastly, it reduces the fields used when saving the bredding record to the reservoir Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #24 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- RM: I like to have another look at this one too still. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |BLOCKED --- Comment #25 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Taking a look here too -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #26 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- my $mss = GetMarcSubfieldStructure( '', { unsafe => 1 } ); # Do not change framework @{$kohafields} = keys %{ $mss } unless $kohafields; foreach my $kohafield ( @{$kohafields} ) { Hmm. I dont understand: Why pass kohafields and still do a GetMarcSubfieldSttructure call ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #27 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #26)
my $mss = GetMarcSubfieldStructure( '', { unsafe => 1 } ); # Do not change framework @{$kohafields} = keys %{ $mss } unless $kohafields; foreach my $kohafield ( @{$kohafields} ) { Hmm. I dont understand: Why pass kohafields and still do a GetMarcSubfieldSttructure call ?
Misreading the change. Sorry. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #28 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Coming back here very soon. Please keep status. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #29 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #28)
Coming back here very soon. Please keep status.
Ok, do you have an idea of the timing for this one? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #30 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #29)
(In reply to Marcel de Rooy from comment #28)
Coming back here very soon. Please keep status.
Ok, do you have an idea of the timing for this one?
Will be going further this afternoon. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135374|0 |1 is obsolete| | --- Comment #31 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 135763 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135763&action=edit Bug 30813: Update TransformMarcToKoha to accept a hashref This patch updates all the calls to pass a hasref rather than an array It also removes the no longer used framework parameter To test: prove -v t/Biblio.t t/db_dependent/Biblio/TransformMarcToKoha.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135375|0 |1 is obsolete| | --- Comment #32 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 135764 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135764&action=edit Bug 30813: Adjust TransformMarcToKoha to take kohafields parameter This adjusts the routine to accept an arrayref of koha fields to process To test: prove -v t/db_dependent/Biblio/TransformMarcToKoha.t t/Biblio.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135376|0 |1 is obsolete| | --- Comment #33 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 135765 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135765&action=edit Bug 30813: Remove TransformMarcToKohaOneField To test: 1 - prove -v t/db_dependent/Biblio/TransformMarcToKoha.t t/db_dependent/Breeding.t 2 - Test Z3950 search in advanced catalog editor Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135377|0 |1 is obsolete| | --- Comment #34 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 135766 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135766&action=edit Bug 30813: Remove Koha::MetadataRecord::getKohaField This was essentially a wrapper around TransformKohaToMarcOneField After changing and updating, it seems easier not to create the intermediary object and to just transform the data Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135378|0 |1 is obsolete| | --- Comment #35 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 135767 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135767&action=edit Bug 30813: (follow-up) ImportBatch updates Missed these in the original commits Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135379|0 |1 is obsolete| | --- Comment #36 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 135768 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135768&action=edit Bug 30813: (follow-up) Correct C4::Breeding call This patch changes the call to use the fully qualified name and adds import to C4::Breeding, Koha::MetaSearcher, and removes import from Koha::MetadataRecord Additionally it replaces missing fields from the update to using TransformMarcToKoha Lastly, it reduces the fields used when saving the bredding record to the reservoir Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #37 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 135769 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135769&action=edit Bug 30813: (QA follow-up) Adjust three use statements Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #38 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Great work, Nick. Removing that framework parameter was still something far down on my todo list ;) Might still be a report for; will close it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #39 from Nick Clemens <nick@bywatersolutions.com> --- Why add the qw(); to the use statements? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #40 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Nick Clemens from comment #39)
Why add the qw(); to the use statements?
That is essential to prevent needlessly importing all default exported routines from the module. (EXPORT_OK routines) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #41 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Marcel de Rooy from comment #40)
(In reply to Nick Clemens from comment #39)
Why add the qw(); to the use statements?
That is essential to prevent needlessly importing all default exported routines from the module. (EXPORT_OK routines)
From bug 17600 I understood that EXPORT_OK was 'on demand' i.e. only explicitly named subroutines are imported. Is that incorrect?
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #42 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Nick Clemens from comment #41)
(In reply to Marcel de Rooy from comment #40)
(In reply to Nick Clemens from comment #39)
Why add the qw(); to the use statements?
That is essential to prevent needlessly importing all default exported routines from the module. (EXPORT_OK routines)
From bug 17600 I understood that EXPORT_OK was 'on demand' i.e. only explicitly named subroutines are imported. Is that incorrect?
Ah. You might very well be right. EXPORT versus EXPORT_OK So yes, might not be needed then. But explicitly stating that you dont want to import cannot be wrong either. I would recommend keeping them. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #43 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Please explicitly import the subroutines that are used in the scripts/modules, that's the point of bug 17600. That helps to clean the import (remove the 'use' statements when no subroutines are imported). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #44 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #43)
Please explicitly import the subroutines that are used in the scripts/modules, that's the point of bug 17600. That helps to clean the import (remove the 'use' statements when no subroutines are imported).
No. You may want to require a module without importing its names. So you do use Module qw(); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #45 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Marcel de Rooy from comment #44)
(In reply to Jonathan Druart from comment #43)
Please explicitly import the subroutines that are used in the scripts/modules, that's the point of bug 17600. That helps to clean the import (remove the 'use' statements when no subroutines are imported).
No. You may want to require a module without importing its names. So you do use Module qw();
No? I can assure you that it's why I wrote bug 17600. We want to EXPLICITLY export the subroutines we will be using in the scripts/modules. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #46 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #45)
(In reply to Marcel de Rooy from comment #44)
(In reply to Jonathan Druart from comment #43)
Please explicitly import the subroutines that are used in the scripts/modules, that's the point of bug 17600. That helps to clean the import (remove the 'use' statements when no subroutines are imported).
No. You may want to require a module without importing its names. So you do use Module qw();
No? I can assure you that it's why I wrote bug 17600. We want to EXPLICITLY export the subroutines we will be using in the scripts/modules.
You dont understand what I mean. Please read it again. No refers to the case where we do not import. I say no, do not remove the use statement when you want to require the module anyway. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #47 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Ok see IRC for a lively discussion on how 17600 was meant ;) The implications here are: The last patch that 'corrected' a few use statements needs tweaking (or its predecessors). Although we do not need to import TransformMarcToKoha there since we call with prefix C4::Biblio, we should do it anyway for transparency/documentation etc. Will adjust the patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135769|0 |1 is obsolete| | --- Comment #48 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 135803 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135803&action=edit Bug 30813: (QA follow-up) Adjust three use statements Altough we used the namespace when calling, the intention of bug 17600 was that we do import the routines that we are calling here. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #49 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30813 --- Comment #50 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 135825 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135825&action=edit Bug 30813: (follow-up) Fix tests import Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org