Compare commits
18 Commits
7bddfeb412
...
1e350b5bb6
Author | SHA1 | Date |
---|---|---|
|
1e350b5bb6 | 2 years ago |
|
3f0d86b2cb | 2 years ago |
|
10de703d61 | 2 years ago |
|
80f393cc3e | 2 years ago |
|
e6cdda9b01 | 2 years ago |
|
d50aad2a91 | 2 years ago |
|
8ee29390f1 | 2 years ago |
|
c483fecc63 | 2 years ago |
|
6f6c364ee0 | 2 years ago |
|
288ef82461 | 2 years ago |
|
5ddb520b96 | 2 years ago |
|
e34fa5b511 | 2 years ago |
|
27793b8979 | 2 years ago |
|
62316cd585 | 2 years ago |
|
8a280a7d54 | 2 years ago |
|
ee3ffed6f5 | 2 years ago |
|
90090a3601 | 2 years ago |
|
294741b1df | 2 years ago |
25 changed files with 173 additions and 174 deletions
@ -0,0 +1,17 @@ |
|||
use Modern::Perl; |
|||
|
|||
return { |
|||
bug_number => "29341", |
|||
description => "Remove foreign keys on pseudonymized_transactions", |
|||
up => sub { |
|||
my ($args) = @_; |
|||
my ($dbh, $out) = @$args{qw(dbh out)}; |
|||
for my $fk ( qw( pseudonymized_transactions_borrowers_ibfk_2 pseudonymized_transactions_borrowers_ibfk_3 pseudonymized_transactions_ibfk_1 ) ) { |
|||
if ( foreign_key_exists( 'pseudonymized_transactions', $fk ) ) { |
|||
$dbh->do(qq{ |
|||
ALTER TABLE pseudonymized_transactions DROP FOREIGN KEY $fk |
|||
}); |
|||
} |
|||
} |
|||
}, |
|||
} |
@ -0,0 +1,11 @@ |
|||
use Modern::Perl; |
|||
|
|||
return { |
|||
bug_number => "5229", |
|||
description => "Remove system preference 'OPACItemsResultsDisplay'", |
|||
up => sub { |
|||
my ($args) = @_; |
|||
my ($dbh, $out) = @$args{qw(dbh out)}; |
|||
$dbh->do(q{DELETE FROM systempreferences WHERE variable='OPACItemsResultsDisplay'}); |
|||
}, |
|||
} |
File diff suppressed because one or more lines are too long
@ -0,0 +1,74 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
# Copyright 2021 Koha Development team |
|||
# |
|||
# This file is part of Koha |
|||
# |
|||
# Koha is free software; you can redistribute it and/or modify it |
|||
# under the terms of the GNU General Public License as published by |
|||
# the Free Software Foundation; either version 3 of the License, or |
|||
# (at your option) any later version. |
|||
# |
|||
# Koha is distributed in the hope that it will be useful, but |
|||
# WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU General Public License |
|||
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
|||
|
|||
use Modern::Perl; |
|||
|
|||
use Test::More tests => 1; |
|||
use Test::MockModule; |
|||
use JSON qw( encode_json decode_json ); |
|||
|
|||
use Koha::Database; |
|||
use Koha::BackgroundJobs; |
|||
use Koha::BackgroundJob::BatchUpdateBiblio; |
|||
use Koha::Exceptions::Exception; |
|||
use t::lib::TestBuilder; |
|||
|
|||
my $schema = Koha::Database->new->schema; |
|||
|
|||
my $builder = t::lib::TestBuilder->new; |
|||
|
|||
subtest "Exceptions must be stringified" => sub { |
|||
plan tests => 1; |
|||
|
|||
$schema->storage->txn_begin; |
|||
|
|||
my $C4_biblio_module = Test::MockModule->new('C4::Biblio'); |
|||
$C4_biblio_module->mock( 'ModBiblio', |
|||
sub { Koha::Exceptions::Exception->throw("It didn't work"); } ); |
|||
|
|||
my $biblio = $builder->build_sample_biblio; |
|||
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
|||
my $job = Koha::BackgroundJob::BatchUpdateBiblio->new( |
|||
{ |
|||
status => 'new', |
|||
size => 1, |
|||
borrowernumber => $patron->borrowernumber, |
|||
type => 'batch_biblio_record_modification', |
|||
data => encode_json { |
|||
record_ids => [ $biblio->biblionumber ], |
|||
} |
|||
} |
|||
)->store; |
|||
$job = Koha::BackgroundJobs->find( $job->id ); |
|||
$job->process( |
|||
{ job_id => $job->id, record_ids => [ $biblio->biblionumber ] } ); |
|||
|
|||
my $data = decode_json $job->get_from_storage->data; |
|||
is_deeply( |
|||
$data->{messages}->[0], |
|||
{ |
|||
biblionumber => $biblio->biblionumber, |
|||
code => 'biblio_not_modified', |
|||
error => "It didn't work", |
|||
type => "error" |
|||
} |
|||
); |
|||
|
|||
$schema->storage->txn_rollback; |
|||
}; |
Loading…
Reference in new issue