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

(-)a/Koha/Exporter/Record.pm (-1 / +6 lines)
Lines 134-140 sub export { Link Here
134
        print MARC::File::XML::footer();
134
        print MARC::File::XML::footer();
135
        print "\n";
135
        print "\n";
136
    } elsif ( $format eq 'csv' ) {
136
    } elsif ( $format eq 'csv' ) {
137
        $csv_profile_id ||= Koha::CsvProfiles->search({ profile => C4::Context->preference('ExportWithCsvProfile') })->export_format_id;
137
        unless ( $csv_profile_id ) {
138
            # FIXME export_format.profile should be a unique key
139
            my $csv_profiles = Koha::CsvProfiles->search({ profile => C4::Context->preference('ExportWithCsvProfile') });
140
            die "The ExportWithCsvProfile system preference is not defined or does not match a valid csv profile" unless $csv_profiles->count;
141
            $csv_profile_id = $csv_profiles->next->export_format_id;
142
        }
138
        print marc2csv( $record_ids, $csv_profile_id, $itemnumbers );
143
        print marc2csv( $record_ids, $csv_profile_id, $itemnumbers );
139
    }
144
    }
140
145
(-)a/misc/export_records.pl (-2 / +3 lines)
Lines 195-202 if ($deleted_barcodes) { Link Here
195
}
195
}
196
else {
196
else {
197
    unless ( $csv_profile_id ) {
197
    unless ( $csv_profile_id ) {
198
        my $default_csv_profile = Koha::CsvProfiles->search({ profile => C4::Context->preference('ExportWithCsvProfile') });
198
        # FIXME export_format.profile should be a unique key
199
        $csv_profile_id = $default_csv_profile ? $default_csv_profile->export_format_id : undef;
199
        my $default_csv_profiles = Koha::CsvProfiles->search({ profile => C4::Context->preference('ExportWithCsvProfile') });
200
        $csv_profile_id = $default_csv_profiles->count ? $default_csv_profiles->next->export_format_id : undef;
200
    }
201
    }
201
    Koha::Exporter::Record::export(
202
    Koha::Exporter::Record::export(
202
        {   record_type        => $record_type,
203
        {   record_type        => $record_type,
(-)a/tools/export.pl (-3 / +3 lines)
Lines 192-199 if ( $op eq "export" ) { Link Here
192
192
193
        my $csv_profile_id = $query->param('csv_profile_id');
193
        my $csv_profile_id = $query->param('csv_profile_id');
194
        unless ( $csv_profile_id ) {
194
        unless ( $csv_profile_id ) {
195
            my $default_csv_profile = Koha::CsvProfiles->search({ profile => C4::Context->preference('ExportWithCsvProfile') });
195
            # FIXME export_format.profile should be a unique key
196
            $csv_profile_id = $default_csv_profile ? $default_csv_profile->export_format_id : undef;
196
            my $default_csv_profiles = Koha::CsvProfiles->search({ profile => C4::Context->preference('ExportWithCsvProfile') });
197
            $csv_profile_id = $default_csv_profiles->count ? $default_csv_profiles->next->export_format_id : undef;
197
        }
198
        }
198
199
199
        Koha::Exporter::Record::export(
200
        Koha::Exporter::Record::export(
200
- 

Return to bug 15451