Koha-clms/t
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
..
Acquisition
…
Biblio
…
Budgets
…
Circulation Bug 37155: Refactor GetAgeRestrictions 2024-07-01 18:55:50 +02:00
External
…
Koha Bug 22223: Add filter to make item URLs safe in template output 2024-11-07 16:29:18 +01:00
Number Bug 37511: Unit tests 2024-10-30 11:57:27 +01:00
SIP
…
Search Bug 34969: Remove unneeded module from buildQuery.t 2023-10-04 09:15:42 -04:00
Serials Bug 32392: Tests for changes in C4::Serials::GetNextSeq 2024-04-29 15:19:30 +02:00
Template Bug 33030: Add unit tests 2023-07-14 16:52:06 -03:00
Test
…
cypress Bug 38128: Fix cypress test 2024-11-07 16:29:11 +01:00
data Bug 31393: Koha::Config: handle the special case for 'content' attribute 2023-10-30 09:02:17 -03:00
db_dependent Bug 31224: Move item field removal up to $metadata->record 2024-11-08 11:23:44 +01:00
edi_testfiles Bug 38271: Handle missing 008 fields in EDI 2024-10-29 08:46:38 +01:00
etc
…
lib Bug 22223: t::lib::QA::TemplateFilters missing built-in TT filter "safe_url" causes false warnings 2024-11-07 16:29:19 +01:00
mock_templates/intranet-tmpl/prog Bug 36694: (follow-up) Remove some missed instances 2024-10-21 12:26:07 +02:00
00-check-atomic-updates.t Bug 31479: Option to skip t/00-check-atomic-updates.t when building custom packages 2023-05-10 15:26:20 -03:00
00-deprecated.t
…
00-load.t
…
00-merge-conflict-markers.t
…
00-testcritic.t Bug 34911: Test files from HEAD instead of 'master' 2023-10-04 09:15:35 -04:00
00-valid-xml.t
…
Auth.t
…
AuthoritiesMarc_MARC21.t
…
AuthoritiesMarc_UNIMARC.t
…
Barcodes_EAN13.t
…
Barcodes_annual.t
…
Barcodes_hbyymmincr.t
…
Barcodes_incremental.t
…
Biblio.t Bug 37380: Replace uses of GetMarcControlnumber for get_control_number() 2024-09-16 10:41:05 +02:00
Biblio2.t
…
Budgets.t
…
Charset.t
…
Circulation_barcodedecode.t
…
ClassSortRoutine.t
…
ClassSortRoutine_Dewey.t
…
ClassSortRoutine_Generic.t
…
ClassSortRoutine_LCC.t
…
ClassSource.t
…
Context.t Bug 29033: Add C4::Context->multivalue_preference 2023-10-10 10:53:59 -03:00
Contract.t
…
CookieManager.t
…
Creators.t
…
DateUtils.t Bug 36432: Remove circular dependency from Koha::Object 2024-04-04 15:24:32 +02:00
EdiInvoice.t
…
Edifact.t Bug 35398: Add unit test for extraction of library_rotation_plan 2024-03-07 15:02:46 +01:00
Ediorder.t
…
Ediordrsp.t
…
Form_MessagingPreferences.t
…
HtmlTags.t
…
ImportBatch.t
…
Installer_PerlModules.t
…
ItemCirculationAlertPreference.t
…
Koha_MetadataRecord.t Bug 33749: Use TrimFields instead of stripWhitespaceChars 2023-11-03 12:08:06 -03:00
Koha_SearchEngine_Elasticsearch_Browse.t
…
Koha_Template_Plugin_HtmlId.t
…
Koha_Template_Plugin_Koha.t
…
Koha_Util_FrameworkPlugin.t
…
Koha_Util_MARC.t
…
Koha_XSLT_HTTPS.t
…
Labels.t
…
Labels_split_Regex.t
…
Labels_split_ccn.t
…
Labels_split_ddcn.t
…
Labels_split_lccn.t
…
Languages.t
…
Logger.t Bug 35907: Add ability to log all custom report runs with or without query 2024-05-10 16:45:45 +02:00
Makefile.t
…
Members_Messaging.t
…
OpenLibrarySearch.t
…
Output.t Bug 30524: Unit tests 2023-08-07 20:59:59 -03:00
Output_JSONStream.t
…
Patroncards.t
…
Patroncards_Batch.t
…
Patroncards_Lib.t
…
Patroncards_Patroncard.t
…
Patroncards_Profile.t
…
Patroncards_Template.t
…
RecordProcessor.t Bug 33749: (QA follow-up) Tidy code for qa script 2023-11-03 12:08:07 -03:00
Ris.t
…
SMS.t Bug 36307: SMS::Send driver errors are not captured and stored 2024-04-05 17:39:46 +02:00
Scheduler.t
…
Scrubber.t Bug 36328: (QA follow-up) Expand tests and reorder elements to clarify differences 2024-04-22 12:39:20 +02:00
Search.t Bug 34968: Remove unneeded module from Search.t 2023-10-04 09:32:46 -04:00
Search_PazPar2.t
…
SimpleMARC.t Bug 36515: (QA follow-up) Tidy code 2024-08-02 19:00:05 +02:00
SuggestionEngine.t
…
SuggestionEngine_AuthorityFile.t Bug 34970: Remove most modules from SuggestionEngine_AuthorityFile.t 2023-10-04 09:15:41 -04:00
TmplToken.t
…
Token.t Bug 36367: Fix test t/Token.t 2024-06-14 11:17:19 +01:00
dummy.t
…
template_filters.t
…
timezones.t
…