Bugzilla – Attachment 157431 Details for
Bug 35099
Cannot load records with invalid marcxml
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35099: Prevent crash from invalid marc in the parent record
Bug-35099-Prevent-crash-from-invalid-marc-in-the-p.patch (text/plain), 1.40 KB, created by
Martin Renvoize (ashimema)
on 2023-10-19 12:41:46 UTC
(
hide
)
Description:
Bug 35099: Prevent crash from invalid marc in the parent record
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-10-19 12:41:46 UTC
Size:
1.40 KB
patch
obsolete
>From aa3a34e831c13361afb8264573acae4dc4b6a8fd Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 19 Oct 2023 11:49:26 +0000 >Subject: [PATCH] Bug 35099: Prevent crash from invalid marc in the parent > record > >When getting the query for components, we need to parse the MARC::Record. >If that fails, we simply should not attempt the component search as the user should see a warning about the degraded MARC > >To test: >prove -v t/db_dependent/selenium/regressions.t >It fails >apply patch, restart_all >prove -v t/db_dependent/selenium/regressions.t >It passes > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Biblio.pm | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index fc38955718c..0326c1c8147 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -767,7 +767,12 @@ sub get_volumes_query { > # MARC21 Only for now > return if ( C4::Context->preference('marcflavour') ne 'MARC21' ); > >- my $marc = $self->metadata->record; >+ # If the marc cannot be loaded, do not build the query >+ # the staff interface should already be displaying an error message in this case >+ # so we don't need to return the error >+ my $marc; >+ eval { $marc = $self->metadata->record;}; >+ return unless $marc; > > # Only build volumes query if we're in a 'Set' record > # or we have a monographic series. >-- >2.41.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 35099
:
157394
|
157398
|
157423
|
157430
|
157431
|
157432
|
157510
|
157513
|
157515