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

(-)a/C4/Biblio.pm (-5 / +3 lines)
Lines 113-118 use Koha::Plugins; Link Here
113
use Koha::RecordProcessor;
113
use Koha::RecordProcessor;
114
use Koha::SearchEngine;
114
use Koha::SearchEngine;
115
use Koha::SearchEngine::Indexer;
115
use Koha::SearchEngine::Indexer;
116
use Koha::SimpleMARC;
116
use Koha::Libraries;
117
use Koha::Libraries;
117
use Koha::Util::MARC;
118
use Koha::Util::MARC;
118
119
Lines 2850-2861 sub ModBiblioMarc { Link Here
2850
        }
2851
        }
2851
    }
2852
    }
2852
2853
2853
    #enhancement 5374: update transaction date (005) for marc21/unimarc
2854
    # Insert/update transaction time (005) for marc21/unimarc
2854
    if($encoding =~ /MARC21|UNIMARC/) {
2855
    if($encoding =~ /MARC21|UNIMARC/) {
2855
      my @a= (localtime) [5,4,3,2,1,0]; $a[0]+=1900; $a[1]++;
2856
        Koha::SimpleMARC::update_last_transaction_time( { record => $record } );
2856
        # YY MM DD HH MM SS (update year and month)
2857
      my $f005= $record->field('005');
2858
      $f005->update(sprintf("%4d%02d%02d%02d%02d%04.1f",@a)) if $f005;
2859
    }
2857
    }
2860
2858
2861
    if ( C4::Context->preference('StripWhitespaceChars') ) {
2859
    if ( C4::Context->preference('StripWhitespaceChars') ) {
(-)a/t/db_dependent/Biblio.t (-2 / +16 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 21;
20
use Test::More tests => 22;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Test::Warn;
22
use Test::Warn;
23
use List::MoreUtils qw( uniq );
23
use List::MoreUtils qw( uniq );
Lines 1058-1063 subtest 'UpdateTotalIssues on Invalid record' => sub { Link Here
1058
};
1058
};
1059
1059
1060
1060
1061
subtest 'AddBiblio/ModBiblio calling ModBiblioMarc for field 005' => sub {
1062
    plan tests => 2;
1063
1064
    my $marc_record    = MARC::Record->new;
1065
    my ($biblionumber) = C4::Biblio::AddBiblio( $marc_record, '' );
1066
    my $biblio         = Koha::Biblios->find($biblionumber);
1067
1068
    my $field = $biblio->metadata->record->field('005');
1069
    ok( $field && $field->data, 'Record contains field 005 after AddBiblio' );
1070
    $marc_record = MARC::Record->new;
1071
    C4::Biblio::ModBiblio( $marc_record, $biblionumber, '' );
1072
    $field = $biblio->metadata->record->field('005');
1073
    ok( $field && $field->data, 'Record contains field 005 after ModBiblio' );
1074
};
1075
1061
# Cleanup
1076
# Cleanup
1062
Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" );
1077
Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" );
1063
$schema->storage->txn_rollback;
1078
$schema->storage->txn_rollback;
1064
- 

Return to bug 35993