Bugzilla – Attachment 21520 Details for
Bug 10961
Error in GetMarcBiblio can cause severe data loss
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10961 - Error in GetMarcBiblio can cause severe data loss
Bug-10961---Error-in-GetMarcBiblio-can-cause-sever.patch (text/plain), 2.08 KB, created by
Kyle M Hall (khall)
on 2013-09-27 16:54:14 UTC
(
hide
)
Description:
Bug 10961 - Error in GetMarcBiblio can cause severe data loss
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-09-27 16:54:14 UTC
Size:
2.08 KB
patch
obsolete
>From 2d27b4b0ef80c0aa011ea71d1770ef81b038f830 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 27 Sep 2013 12:53:39 -0400 >Subject: [PATCH] Bug 10961 - Error in GetMarcBiblio can cause severe data loss > >A bug in GetMarcBiblio can cause severe data loss if your database has >records where the biblionumber and biblioitemnumber do not match and the >script misc/batchRebuildBiblioTables.pl is run. > >The Biblio::GetMarcBiblio makes a kall to >C4::Biblio::_koha_marc_update_bib_ids which passes the biblionumber as >both the biblionumber *and the biblioitemnumber*. > >Thus, if your biblio and biblioitem numbers are not always equal, you >will end up with a record where the biblioitemnumber is incorrect in the >record! > >This is usually not a severe issue, but since batchRebuildBiblioTables >uses that record to update the database tables, it ends up updating the >wrong biblioitem row! >--- > C4/Biblio.pm | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index cf83ae6..28361c4 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -1252,7 +1252,7 @@ sub GetMarcBiblio { > my $biblionumber = shift; > my $embeditems = shift || 0; > my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare("SELECT marcxml FROM biblioitems WHERE biblionumber=? "); >+ my $sth = $dbh->prepare("SELECT * FROM biblioitems WHERE biblionumber=? "); > $sth->execute($biblionumber); > my $row = $sth->fetchrow_hashref; > my $marcxml = StripNonXmlChars( $row->{'marcxml'} ); >@@ -1264,8 +1264,8 @@ sub GetMarcBiblio { > if ($@) { warn " problem with :$biblionumber : $@ \n$marcxml"; } > return unless $record; > >- C4::Biblio::_koha_marc_update_bib_ids($record, '', $biblionumber, $biblionumber); >- C4::Biblio::EmbedItemsInMarcBiblio($record, $biblionumber) if ($embeditems); >+ C4::Biblio::_koha_marc_update_bib_ids($record, '', $biblionumber, $row->{biblioitemnumber}); >+ C4::Biblio::EmbedItemsInMarcBiblio($record, $biblionumber) if ($embeditems); > > return $record; > } else { >-- >1.7.2.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 10961
:
21520
|
41130
|
41182
|
41183
|
41214
|
41215