[Bug 18579] New: Problème with :Filter::MARC:: EmbedItemsAvailability
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Bug ID: 18579 Summary: Problème with :Filter::MARC::EmbedItemsAvailability Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: gmcharlt@gmail.com Reporter: koha@univ-lyon3.fr QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl This is a real bug, in Koha::Filter::MARC::EmbedItemsAvailability::_processrecord, $biblionumber_field should be corrected to allow controlfield like 001. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Koha Team Lyon 3 <koha@univ-lyon3.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m, koha@univ-lyon3.fr -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |critical CC| |julian.maurice@biblibre.com --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Upgrading severity to critical, this prevents reindexing zebra: $ misc/migration_tools/rebuild_zebra.pl -r -b -v Zebra configuration information ================================ Zebra biblio directory = /home/koha/env/master/var/lib/zebradb/biblios Zebra authorities directory = /home/koha/env/master/var/lib/zebradb/authorities Koha directory = /home/koha/env/master/src Lockfile = /home/koha/env/master/var/lock/zebradb/rebuild/rebuild..LCK BIBLIONUMBER in : 001$@ BIBLIOITEMNUMBER in : 090$a ================================ skipping authorities ==================== exporting biblio ==================== 1Control fields (generally, just tags below 010) do not have subfields, use data() at /home/koha/env/master/src/Koha/Filter/MARC/EmbedItemsAvailability.pm line 75. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Koha Team Lyon 3 from comment #0)
This is a real bug, in Koha::Filter::MARC::EmbedItemsAvailability::_processrecord, $biblionumber_field should be corrected to allow controlfield like 001.
Good catch! Should use logic as in Koha/SearchEngine/Search.pm (extract_biblionumber). Ping Tomas -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Problème with |Problem with |:Filter::MARC::EmbedItemsAv |:Filter::MARC::EmbedItemsAv |ailability |ailability -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |master Assignee|gmcharlt@gmail.com |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 63389 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63389&action=edit Bug 18579: Regression tests This patch makes sure the tests have the biblio.biblionumber mapping mocked so we test the case where the mapping is to a control field instead of just regular data fields (in the case of UNIMARC). To test: - Apply the patch - Run: $ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t => FAIL: Tests fail due to an attemp to access a subfield on a control field. Sponsored-by: ByWater Solutions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 63390 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63390&action=edit Bug 18579: Make EmbedItemsAvailability handle control fields correctly This patch makes the EmbedItemsAvailability filter handle the biblio.biblionumber > control field mapping gracefully. Right now, it was assuming a regular data field was used, and such is not the case for UNIMARC (001). To test: - Apply the tests patch - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t => FAIL: Tests fail to run - Apply this patch - Run: k$ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: ByWater Solutions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Hi, please test on your UNIMARC test environment! I provided a fix for the tests so they actually cover the control field case, and the patch correctly makes it work as expected (thanks marcelr for the pointer). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63389|0 |1 is obsolete| | Attachment #63390|0 |1 is obsolete| | --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 63394 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63394&action=edit [SIGNED OFF] Bug 18579: Regression tests This patch makes sure the tests have the biblio.biblionumber mapping mocked so we test the case where the mapping is to a control field instead of just regular data fields (in the case of UNIMARC). To test: - Apply the patch - Run: $ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t => FAIL: Tests fail due to an attemp to access a subfield on a control field. Sponsored-by: ByWater Solutions Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 63395 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63395&action=edit [SIGNED OFF] Bug 18579: Make EmbedItemsAvailability handle control fields correctly This patch makes the EmbedItemsAvailability filter handle the biblio.biblionumber > control field mapping gracefully. Right now, it was assuming a regular data field was used, and such is not the case for UNIMARC (001). To test: - Apply the tests patch - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t => FAIL: Tests fail to run - Apply this patch - Run: k$ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: ByWater Solutions Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=18579 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63394|0 |1 is obsolete| | Attachment #63395|0 |1 is obsolete| | --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 63396 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63396&action=edit Bug 18579: Regression tests This patch makes sure the tests have the biblio.biblionumber mapping mocked so we test the case where the mapping is to a control field instead of just regular data fields (in the case of UNIMARC). To test: - Apply the patch - Run: $ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t => FAIL: Tests fail due to an attemp to access a subfield on a control field. Sponsored-by: ByWater Solutions Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> 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=18579 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 63397 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63397&action=edit Bug 18579: Make EmbedItemsAvailability handle control fields correctly This patch makes the EmbedItemsAvailability filter handle the biblio.biblionumber > control field mapping gracefully. Right now, it was assuming a regular data field was used, and such is not the case for UNIMARC (001). To test: - Apply the tests patch - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t => FAIL: Tests fail to run - Apply this patch - Run: k$ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: ByWater Solutions Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> 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=18579 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #10 from Julian Maurice <julian.maurice@biblibre.com> --- There are still problems in a UNIMARC setup: # Failed test 'EmbedItemsAvailability tests' # at t/db_dependent/Koha/Filter/EmbedItemsAvailability.t line 151. Can't call method "subfield" on an undefined value at t/db_dependent/Koha/Filter/EmbedItemsAvailability.t line 145. and rebuild_zebra.pl die with: Arguments must be MARC::Field objects at /home/koha/env/master/src/Koha/Filter/MARC/EmbedItemsAvailability.pm line 93 I'm working on a patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Good catch Julian. (Poor Tomas ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 --- Comment #12 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 63414 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63414&action=edit Bug 18579: Fix call to append_fields, fix tests MARC::Record::append_fields takes a list of MARC::Field (not an arrayref) Use $record->subfield() instead of $record->field()->subfield() to avoid errors when field doesn't exist -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #13 from Julian Maurice <julian.maurice@biblibre.com> --- Back to Signed off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=18579 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63414|0 |1 is obsolete| | --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 63415 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63415&action=edit Bug 18579: Fix call to append_fields, fix tests MARC::Record::append_fields takes a list of MARC::Field (not an arrayref) Use $record->subfield() instead of $record->field()->subfield() to avoid errors when field doesn't exist 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=18579 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #11)
Good catch Julian. (Poor Tomas ;)
Hahaha -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Passed QA |Pushed to Master --- Comment #16 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Tomas, Julian! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Patches don't apply to 16.11.x - please provide patches for 16.11.x if it's needed there too! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |18208 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 [Bug 18208] Add RecordProcessor filter to inject not onloan count to MARC records -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Katrin Fischer from comment #17)
Patches don't apply to 16.11.x - please provide patches for 16.11.x if it's needed there too!
Not needed! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org