View | Details | Raw Unified | Return to bug 14367
Collapse All | Expand All

(-)a/C4/Biblio.pm (-3 / +3 lines)
Lines 301-307 sub ModBiblio { Link Here
301
    # update biblionumber and biblioitemnumber in MARC
301
    # update biblionumber and biblioitemnumber in MARC
302
    # FIXME - this is assuming a 1 to 1 relationship between
302
    # FIXME - this is assuming a 1 to 1 relationship between
303
    # biblios and biblioitems
303
    # biblios and biblioitems
304
    my $sth = $dbh->prepare("select biblioitemnumber,history from biblioitems where biblionumber=?");
304
    my $sth = $dbh->prepare("select biblioitems.biblioitemnumber, biblio_metadata.history from biblioitems, biblio_metadata where biblioitems.biblionumber=?");
305
    $sth->execute($biblionumber);
305
    $sth->execute($biblionumber);
306
    my ($biblioitemnumber, $history) = $sth->fetchrow;
306
    my ($biblioitemnumber, $history) = $sth->fetchrow;
307
    $sth->finish();
307
    $sth->finish();
Lines 3363-3370 sub ModBiblioMarc { Link Here
3363
    my $newhistory = HistoryUpdate($newrecord, $historylength, $history);
3363
    my $newhistory = HistoryUpdate($newrecord, $historylength, $history);
3364
    $newhistory = encode_json($newhistory);
3364
    $newhistory = encode_json($newhistory);
3365
3365
3366
    $sth = $dbh->prepare("UPDATE biblioitems SET marc=?,marcxml=?,history=? WHERE biblionumber=?");
3366
    $sth = $dbh->prepare("UPDATE biblio_metadata SET metadata=?,history=? WHERE biblionumber=?");
3367
    $sth->execute( $record->as_usmarc(), $record->as_xml_record($encoding), $newhistory, $biblionumber );
3367
    $sth->execute( $record->as_xml_record($encoding), $newhistory, $biblionumber );
3368
    $sth->finish;
3368
    $sth->finish;
3369
3369
3370
    ModZebra( $biblionumber, "specialUpdate", "biblioserver", $record );
3370
    ModZebra( $biblionumber, "specialUpdate", "biblioserver", $record );
(-)a/Koha/MetadataRecord/History.pm (-2 / +2 lines)
Lines 68-77 sub GetMarcBiblioHistory { Link Here
68
        return;
68
        return;
69
    }
69
    }
70
    my $dbh = C4::Context->dbh;
70
    my $dbh = C4::Context->dbh;
71
    my $sth = $dbh->prepare("SELECT marcxml,history FROM biblioitems WHERE biblionumber=? ");
71
    my $sth = $dbh->prepare("SELECT metadata,history FROM biblio_metadata WHERE biblionumber=? ");
72
    $sth->execute($biblionumber);
72
    $sth->execute($biblionumber);
73
    my $row = $sth->fetchrow_hashref;
73
    my $row = $sth->fetchrow_hashref;
74
    my $marcxml = StripNonXmlChars( $row->{'marcxml'} );
74
    my $marcxml = StripNonXmlChars( $row->{'metadata'} );
75
    MARC::File::XML->default_record_format( C4::Context->preference('marcflavour') );
75
    MARC::File::XML->default_record_format( C4::Context->preference('marcflavour') );
76
    my $record = MARC::Record->new();
76
    my $record = MARC::Record->new();
77
    my ($history, $borrowers) = HistoryParse( $row->{'history'} );
77
    my ($history, $borrowers) = HistoryParse( $row->{'history'} );
(-)a/installer/data/mysql/atomicupdate/add_history.sql (-1 lines)
Line 1 Link Here
1
ALTER TABLE biblioitems ADD COLUMN `history` LONGTEXT DEFAULT NULL AFTER `marcxml`;
(-)a/installer/data/mysql/atomicupdate/bug_14367_-_add_history_column.perl (-1 / +9 lines)
Line 0 Link Here
0
- 
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    unless( column_exists( 'biblio_metadata', 'history' ) ) {
4
        $dbh->do(q|ALTER TABLE biblio_metadata ADD history longtext default NULL AFTER metadata|);
5
    }
6
7
    SetVersion( $DBversion );
8
    print "Upgrade to $DBversion done (Bug 14367: Add column biblio_metadata.history)\n";
9
}

Return to bug 14367