Bugzilla – Attachment 194013 Details for
Bug 35104
We should warn when attempting to save MARC records that contain characters invalid in XML
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35104: Update Exporter/Record.t to bypass store() validation
6fbabb2.patch (text/plain), 1.41 KB, created by
Martin Renvoize (ashimema)
on 2026-02-26 15:28:02 UTC
(
hide
)
Description:
Bug 35104: Update Exporter/Record.t to bypass store() validation
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-02-26 15:28:02 UTC
Size:
1.41 KB
patch
obsolete
>From 6fbabb2c01dc4ec17e6187f7c9aaadb253f0d4e1 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Thu, 26 Feb 2026 15:12:07 +0000 >Subject: [PATCH] Bug 35104: Update Exporter/Record.t to bypass store() > validation > >The test created a bad biblio_metadata record by calling store() with >invalid MARCXML, which now throws Koha::Exceptions::Metadata::Invalid >instead of storing silently. > >Use _result->update() to inject the bad data directly into the DB, >bypassing the store() validation layer, as done elsewhere in the test >suite for testing behaviour with corrupt metadata. >--- > t/db_dependent/Exporter/Record.t | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Exporter/Record.t b/t/db_dependent/Exporter/Record.t >index c77c2afb73a..6d3696d2aa3 100755 >--- a/t/db_dependent/Exporter/Record.t >+++ b/t/db_dependent/Exporter/Record.t >@@ -77,10 +77,8 @@ if ( $marcflavour eq 'UNIMARC' ) { > $homebranch_subfield_code = 'a'; > } > >-my $bad_biblio = Koha::Biblio->new()->store(); >-Koha::Biblio::Metadata->new( >- { biblionumber => $bad_biblio->id, format => 'marcxml', metadata => 'something wrong', schema => $marcflavour } ) >- ->store(); >+my $bad_biblio = $builder->build_sample_biblio; >+$bad_biblio->metadata->_result->update( { metadata => 'something wrong' } ); > my $bad_biblionumber = $bad_biblio->id; > > my $item_1_1 = $builder->build_sample_item( >-- >2.53.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35104
:
157625
|
157627
|
157628
|
157642
|
159615
|
159620
|
159621
|
159630
|
159810
|
159811
|
159812
|
159813
|
166431
|
173145
|
173146
|
176820
|
176821
|
176850
|
176851
|
176852
|
176860
|
193985
|
193986
|
193987
|
193988
|
193989
|
193990
|
193991
|
193992
|
193993
|
193994
|
193995
|
193996
|
193997
|
193998
|
193999
|
194000
|
194001
|
194004
|
194005
|
194006
|
194007
|
194008
|
194009
|
194010
|
194011
|
194012
| 194013