Koha-clms/Koha/Biblio
Tomas Cohen Arazi fd90de9e49
Bug 31224: Move item field removal up to $metadata->record
This patch addresse the fact Koha needs to strip out stray item field in
MARC records coming from the DB. While this is not ideal, it has worked
so far, limiting the negative effects of bad data to Koha users.

I put a FIXME because I think it deserves to be revisited colectively at
some point. I filed bug 38406 to track the discussion around this.

The `marcmarcrecord2csv.t` tests cover this behavior and I thought
removing it was not in the scope of this bug.

I decided to move the removal one step up in the call chain so it
applies to all calls to `$metadata->record`, not only those that ask to
include items. This is the right thing to do while we keep this
behavior.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Record/marcrecord2csv.t
=> FAIL: Item information gets extracted from more items than expected
(i.e. the item in the MARC record is not stripped out so 'Withdrawn'
shows 3 times instead of 2).
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Run:
  k$ prove t/db_dependent/Koha/Biblio/Metadata.t
=> SUCCESS: Tests pass! The behavior change in $metadata->record works
as intended!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 11:23:44 +01:00
..
ItemGroup Bug 33568: Item groups 2024-04-05 15:34:47 +02:00
Metadata Bug 37380: Add get_control_number() to the metadata extractor 2024-09-16 10:41:04 +02:00
ItemGroup.pm Bug 31140: TestBuilder.t is failing on item groups modules 2022-07-12 10:31:35 -03:00
ItemGroups.pm Bug 24857: Add Koha Objects 2022-07-08 15:59:51 -03:00
Metadata.pm Bug 31224: Move item field removal up to $metadata->record 2024-11-08 11:23:44 +01:00
Metadatas.pm
…