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

(-)a/C4/Biblio.pm (-3 / +3 lines)
Lines 297-303 sub ModBiblio { Link Here
297
    # update biblionumber and biblioitemnumber in MARC
297
    # update biblionumber and biblioitemnumber in MARC
298
    # FIXME - this is assuming a 1 to 1 relationship between
298
    # FIXME - this is assuming a 1 to 1 relationship between
299
    # biblios and biblioitems
299
    # biblios and biblioitems
300
    my $sth = $dbh->prepare("select biblioitemnumber,history from biblioitems where biblionumber=?");
300
    my $sth = $dbh->prepare("select biblioitems.biblioitemnumber, biblio_metadata.history from biblioitems, biblio_metadata where biblioitems.biblionumber=?");
301
    $sth->execute($biblionumber);
301
    $sth->execute($biblionumber);
302
    my ($biblioitemnumber, $history) = $sth->fetchrow;
302
    my ($biblioitemnumber, $history) = $sth->fetchrow;
303
    $sth->finish();
303
    $sth->finish();
Lines 3358-3365 sub ModBiblioMarc { Link Here
3358
    my $newhistory = HistoryUpdate($newrecord, $historylength, $history);
3358
    my $newhistory = HistoryUpdate($newrecord, $historylength, $history);
3359
    $newhistory = encode_json($newhistory);
3359
    $newhistory = encode_json($newhistory);
3360
3360
3361
    $sth = $dbh->prepare("UPDATE biblioitems SET marc=?,marcxml=?,history=? WHERE biblionumber=?");
3361
    $sth = $dbh->prepare("UPDATE biblio_metadata SET metadata=?,history=? WHERE biblionumber=?");
3362
    $sth->execute( $record->as_usmarc(), $record->as_xml_record($encoding), $newhistory, $biblionumber );
3362
    $sth->execute( $record->as_xml_record($encoding), $newhistory, $biblionumber );
3363
    $sth->finish;
3363
    $sth->finish;
3364
3364
3365
    ModZebra( $biblionumber, "specialUpdate", "biblioserver", $record );
3365
    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