Bugzilla – Attachment 3053 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 Patch
0001--SIGNED-OFF-Bug-5683-it-is-possible-to-save-corru.patch (text/plain), 1.17 KB, created by
Ian Walls
on 2011-02-02 16:55:14 UTC
(
hide
)
Description:
Signed off Patch
Filename:
MIME Type:
Creator:
Ian Walls
Created:
2011-02-02 16:55:14 UTC
Size:
1.17 KB
patch
obsolete
>From 27c782a20fc4bcf5ec8799a7ef91949b7dda5d4a Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@bywatersolutions.com> >Date: Wed, 2 Feb 2011 11:14:12 -0500 >Subject: [PATCH] [SIGNED OFF] Bug 5683 - it is possible to save corrupt records >Content-Type: text/plain; charset="utf-8" > >This patch makes it impossible to save records with variables fields that don't >contain any subfields. Prior to this patch, link_bibs_to_authorities.pl would >sometimes corrupt records. > >Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com> >--- > C4/Biblio.pm | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 0cc63ab..b151d71 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -326,6 +326,14 @@ sub ModBiblio { > $record->append_fields($field); > } > >+ 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.5.6.5 >
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