Bugzilla – Attachment 4094 Details for
Bug 5683
link_bibs_to_authorities.pl can corrupt records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Signed off follow up 2
0002-Bug-5683-follow-up-calls-to-ModBiblio-can-still-fail.patch (text/plain), 2.01 KB, created by
Chris Cormack
on 2011-05-13 02:10:40 UTC
(
hide
)
Description:
Signed off follow up 2
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2011-05-13 02:10:40 UTC
Size:
2.01 KB
patch
obsolete
>From 4502aac42632c9dba301e38e81b6eb53179abeaf Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@bywatersolutions.com> >Date: Wed, 6 Apr 2011 08:58:07 -0400 >Subject: [Signed Off] [PATCH] Bug 5683 follow-up: calls to ModBiblio can still fail > >Because C4::Charset directly manipulates the MARC::Record object, bad data has >to be cleaned in ModBiblio before the call into C4::Charset. The corrupted >records can also break the Zebra index. After this fix has been applied, it >would probably be a good idea to run the misc/maintenance/touch_all_biblios.pl >script to ensure that this problem has been cleared up. > >Signed-off-by: Jared Camins-Esakov <jcamins@bywatersolutions.com> >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > C4/Biblio.pm | 18 ++++++++++-------- > 1 files changed, 10 insertions(+), 8 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index c9590c2..016b53d 100755 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -299,6 +299,16 @@ sub ModBiblio { > logaction( "CATALOGUING", "MODIFY", $biblionumber, "BEFORE=>" . $newrecord->as_formatted ); > } > >+ # Cleaning up invalid fields must be done early or SetUTF8Flag is liable to >+ # throw an exception which probably won't be handled. >+ foreach my $field ($record->fields()) { >+ if (! $field->is_control_field()) { >+ if (scalar($field->subfields()) == 0 || (scalar($field->subfields()) == 1 && $field->subfield('9'))) { >+ $record->delete_field($field); >+ } >+ } >+ } >+ > SetUTF8Flag($record); > my $dbh = C4::Context->dbh; > >@@ -306,14 +316,6 @@ sub ModBiblio { > > _strip_item_fields($record, $frameworkcode); > >- foreach my $field ($record->fields()) { >- if (! $field->is_control_field()) { >- if (scalar($field->subfields()) == 0) { >- $record->delete_fields($field); >- } >- } >- } >- > # update biblionumber and biblioitemnumber in MARC > # FIXME - this is assuming a 1 to 1 relationship between > # biblios and biblioitems >-- >1.7.4.1 >
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 5683
:
3053
|
3834
|
3835
|
4093
| 4094