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

(-)a/Koha/BackgroundJob/BatchDeleteBiblio.pm (+1 lines)
Lines 71-76 RECORD_IDS: for my $record_id ( sort { $a <=> $b } @record_ids ) { Link Here
71
        # First, checking if issues exist.
71
        # First, checking if issues exist.
72
        # If yes, nothing to do
72
        # If yes, nothing to do
73
        my $biblio = Koha::Biblios->find($biblionumber);
73
        my $biblio = Koha::Biblios->find($biblionumber);
74
        next unless $biblio;
74
75
75
        # TODO Replace with $biblio->get_issues->count
76
        # TODO Replace with $biblio->get_issues->count
76
        if ( C4::Biblio::CountItemsIssued($biblionumber) ) {
77
        if ( C4::Biblio::CountItemsIssued($biblionumber) ) {
(-)a/Koha/BackgroundJob/BatchUpdateAuthority.pm (-2 / +4 lines)
Lines 76-86 RECORD_IDS: for my $record_id ( sort { $a <=> $b } @record_ids ) { Link Here
76
        my $authid = $record_id;
76
        my $authid = $record_id;
77
        my $error  = eval {
77
        my $error  = eval {
78
            my $authority = Koha::MetadataRecord::Authority->get_from_authid($authid);
78
            my $authority = Koha::MetadataRecord::Authority->get_from_authid($authid);
79
            my $record    = $authority->record;
79
            die("Invalid authid: $authid") unless $authority;
80
81
            my $record = $authority->record;
80
            ModifyRecordWithTemplate( $mmtid, $record );
82
            ModifyRecordWithTemplate( $mmtid, $record );
81
            ModAuthority( $authid, $record, $authority->authtypecode, { skip_record_index => 1 } );
83
            ModAuthority( $authid, $record, $authority->authtypecode, { skip_record_index => 1 } );
82
        };
84
        };
83
        if ( $error and $error != $authid or $@ ) {
85
        if ( $error && $error != $authid || $@ ) {
84
            push @messages, {
86
            push @messages, {
85
                type   => 'error',
87
                type   => 'error',
86
                code   => 'authority_not_modified',
88
                code   => 'authority_not_modified',
(-)a/Koha/BackgroundJob/BatchUpdateBiblio.pm (-2 / +4 lines)
Lines 84-90 RECORD_IDS: for my $biblionumber ( sort { $a <=> $b } @record_ids ) { Link Here
84
        # Modify the biblio
84
        # Modify the biblio
85
        my $error = eval {
85
        my $error = eval {
86
            my $biblio = Koha::Biblios->find($biblionumber);
86
            my $biblio = Koha::Biblios->find($biblionumber);
87
            die("Invalid biblionumber: $biblionumber") unless $biblio;
88
87
            my $record = $biblio->metadata->record;
89
            my $record = $biblio->metadata->record;
90
88
            C4::MarcModificationTemplates::ModifyRecordWithTemplate( $mmtid, $record );
91
            C4::MarcModificationTemplates::ModifyRecordWithTemplate( $mmtid, $record );
89
            my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber);
92
            my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber);
90
93
Lines 106-112 RECORD_IDS: for my $biblionumber ( sort { $a <=> $b } @record_ids ) { Link Here
106
                }
109
                }
107
            );
110
            );
108
        };
111
        };
109
        if ( $error and $error != 1 or $@ ) {    # ModBiblio returns 1 if everything as gone well
112
        if ( $error && $error != 1 || $@ ) {    # ModBiblio returns 1 if everything as gone well
110
            push @messages, {
113
            push @messages, {
111
                type         => 'error',
114
                type         => 'error',
112
                code         => 'biblio_not_modified',
115
                code         => 'biblio_not_modified',
113
- 

Return to bug 30255