Bugzilla – Attachment 110139 Details for
Bug 14367
History for MARC records. Roll back changes on a timeline or per field.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14367: (follow-up) Fixing merge conflicts...
Bug-14367-follow-up-Fixing-merge-conflicts.patch (text/plain), 3.48 KB, created by
Aleisha Amohia
on 2020-09-16 02:43:56 UTC
(
hide
)
Description:
Bug 14367: (follow-up) Fixing merge conflicts...
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2020-09-16 02:43:56 UTC
Size:
3.48 KB
patch
obsolete
>From d4de6045c6ac2337aa0fda4efc8060115a0d5b22 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 13 Jun 2017 01:28:26 +0000 >Subject: [PATCH] Bug 14367: (follow-up) Fixing merge conflicts... > >...and other fixes to make patch work. > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/Biblio.pm | 6 +++--- > Koha/MetadataRecord/History.pm | 4 ++-- > .../data/mysql/atomicupdate/bug_14367_-_add_history_column.perl | 9 +++++++++ > 3 files changed, 14 insertions(+), 5 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_14367_-_add_history_column.perl > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 7a75973c15..a322b11108 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -301,7 +301,7 @@ sub ModBiblio { > # update biblionumber and biblioitemnumber in MARC > # FIXME - this is assuming a 1 to 1 relationship between > # biblios and biblioitems >- my $sth = $dbh->prepare("select biblioitemnumber,history from biblioitems where biblionumber=?"); >+ my $sth = $dbh->prepare("select biblioitems.biblioitemnumber, biblio_metadata.history from biblioitems, biblio_metadata where biblioitems.biblionumber=?"); > $sth->execute($biblionumber); > my ($biblioitemnumber, $history) = $sth->fetchrow; > $sth->finish(); >@@ -3160,8 +3160,8 @@ sub ModBiblioMarc { > my $newhistory = HistoryUpdate($newrecord, $historylength, $history); > $newhistory = encode_json($newhistory); > >- $sth = $dbh->prepare("UPDATE biblioitems SET marc=?,marcxml=?,history=? WHERE biblionumber=?"); >- $sth->execute( $record->as_usmarc(), $record->as_xml_record($encoding), $newhistory, $biblionumber ); >+ $sth = $dbh->prepare("UPDATE biblio_metadata SET metadata=?,history=? WHERE biblionumber=?"); >+ $sth->execute( $record->as_xml_record($encoding), $newhistory, $biblionumber ); > $sth->finish; > > ModZebra( $biblionumber, "specialUpdate", "biblioserver", $record ); >diff --git a/Koha/MetadataRecord/History.pm b/Koha/MetadataRecord/History.pm >index 2a4e04addf..66798db504 100644 >--- a/Koha/MetadataRecord/History.pm >+++ b/Koha/MetadataRecord/History.pm >@@ -68,10 +68,10 @@ sub GetMarcBiblioHistory { > return; > } > my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare("SELECT marcxml,history FROM biblioitems WHERE biblionumber=? "); >+ my $sth = $dbh->prepare("SELECT metadata,history FROM biblio_metadata WHERE biblionumber=? "); > $sth->execute($biblionumber); > my $row = $sth->fetchrow_hashref; >- my $marcxml = StripNonXmlChars( $row->{'marcxml'} ); >+ my $marcxml = StripNonXmlChars( $row->{'metadata'} ); > MARC::File::XML->default_record_format( C4::Context->preference('marcflavour') ); > my $record = MARC::Record->new(); > my ($history, $borrowers) = HistoryParse( $row->{'history'} ); >diff --git a/installer/data/mysql/atomicupdate/bug_14367_-_add_history_column.perl b/installer/data/mysql/atomicupdate/bug_14367_-_add_history_column.perl >new file mode 100644 >index 0000000000..b8a1af42fb >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_14367_-_add_history_column.perl >@@ -0,0 +1,9 @@ >+$DBversion = 'XXX'; >+if( CheckVersion( $DBversion ) ) { >+ unless( column_exists( 'biblio_metadata', 'history' ) ) { >+ $dbh->do(q|ALTER TABLE biblio_metadata ADD history longtext default NULL AFTER metadata|); >+ } >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 14367: Add column biblio_metadata.history)\n"; >+} >-- >2.11.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 14367
:
41642
|
56613
|
64243
|
84841
|
84842
|
84859
|
88827
|
88828
|
88829
|
102065
|
102066
|
102067
|
102173
|
102174
|
102175
|
110138
|
110139
|
110140
|
110225
|
110226
|
110227
|
110442
|
110443
|
110444
|
110489
|
110490
|
110491
|
116621
|
120480
|
121025
|
121076
|
126413
|
126414
|
131214
|
131215
|
145655
|
145656
|
146997
|
146998