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

(-)a/C4/Biblio.pm (-3 / +3 lines)
Lines 323-329 sub ModBiblio { Link Here
323
    # update biblionumber and biblioitemnumber in MARC
323
    # update biblionumber and biblioitemnumber in MARC
324
    # FIXME - this is assuming a 1 to 1 relationship between
324
    # FIXME - this is assuming a 1 to 1 relationship between
325
    # biblios and biblioitems
325
    # biblios and biblioitems
326
    my $sth = $dbh->prepare("select biblioitemnumber,history from biblioitems where biblionumber=?");
326
    my $sth = $dbh->prepare("select biblioitems.biblioitemnumber, biblio_metadata.history from biblioitems, biblio_metadata where biblioitems.biblionumber=?");
327
    $sth->execute($biblionumber);
327
    $sth->execute($biblionumber);
328
    my ($biblioitemnumber, $history) = $sth->fetchrow;
328
    my ($biblioitemnumber, $history) = $sth->fetchrow;
329
    $sth->finish();
329
    $sth->finish();
Lines 3499-3506 sub ModBiblioMarc { Link Here
3499
    my $newhistory = HistoryUpdate($newrecord, $historylength, $history);
3499
    my $newhistory = HistoryUpdate($newrecord, $historylength, $history);
3500
    $newhistory = encode_json($newhistory);
3500
    $newhistory = encode_json($newhistory);
3501
3501
3502
    $sth = $dbh->prepare("UPDATE biblioitems SET marc=?,marcxml=?,history=? WHERE biblionumber=?");
3502
    $sth = $dbh->prepare("UPDATE biblio_metadata SET metadata=?,history=? WHERE biblionumber=?");
3503
    $sth->execute( $record->as_usmarc(), $record->as_xml_record($encoding), $newhistory, $biblionumber );
3503
    $sth->execute( $record->as_xml_record($encoding), $newhistory, $biblionumber );
3504
    $sth->finish;
3504
    $sth->finish;
3505
3505
3506
    ModZebra( $biblionumber, "specialUpdate", "biblioserver", $record );
3506
    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/cataloguing/addbiblio.pl (-1 / +1 lines)
Lines 806-812 if ($parentbiblio) { Link Here
806
}
806
}
807
807
808
$is_a_modif = 0;
808
$is_a_modif = 0;
809
    
809
810
if ($biblionumber) {
810
if ($biblionumber) {
811
    $is_a_modif = 1;
811
    $is_a_modif = 1;
812
    my $title = C4::Context->preference('marcflavour') eq "UNIMARC" ? $record->subfield('200', 'a') : $record->title;
812
    my $title = C4::Context->preference('marcflavour') eq "UNIMARC" ? $record->subfield('200', 'a') : $record->title;
(-)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