Merge remote-tracking branch 'upstream/24.05.x' into HEAD
This commit is contained in:
commit
5f73443461
|
|
@ -300,10 +300,10 @@ sub test_connection {
|
|||
my $status;
|
||||
if ( ref($result) eq 'ARRAY' ) {
|
||||
for my $r (@$result) {
|
||||
$status = $r->{Service_Active};
|
||||
$status = $r->{Service_Active} // $r->{ServiceActive};
|
||||
}
|
||||
} else {
|
||||
$status = $result->{Service_Active};
|
||||
$status = $result->{Service_Active} // $result->{ServiceActive};
|
||||
}
|
||||
|
||||
if ($status) {
|
||||
|
|
|
|||
|
|
@ -793,8 +793,9 @@ sub marc_records_to_documents {
|
|||
my $usmarc_record = $record->as_usmarc();
|
||||
|
||||
#NOTE: Try to round-trip the record to prove it will work for retrieval after searching
|
||||
my $decoded_usmarc_record = MARC::Record->new_from_usmarc($usmarc_record);
|
||||
if ( $decoded_usmarc_record->warnings() ) {
|
||||
my $decoded_usmarc_record;
|
||||
eval { $decoded_usmarc_record = MARC::Record->new_from_usmarc($usmarc_record); };
|
||||
if ( $@ || $decoded_usmarc_record->warnings() ) {
|
||||
|
||||
#NOTE: We override the warnings since they're many and misleading
|
||||
@warnings = (
|
||||
|
|
|
|||
|
|
@ -675,6 +675,7 @@ $file_map->{'koha-tmpl/intranet-tmpl/prog/css/mainpage.css'} = 'blib/INTRANET_TM
|
|||
$file_map->{'koha-tmpl/intranet-tmpl/prog/css/staff-global.css'} = 'blib/INTRANET_TMPL_DIR/prog/css/staff-global.css';
|
||||
$file_map->{'koha-tmpl/intranet-tmpl/prog/js/vue/dist/erm.js'} = 'blib/INTRANET_TMPL_DIR/prog/js/vue/dist/erm.js';
|
||||
$file_map->{'koha-tmpl/intranet-tmpl/prog/js/vue/dist/preservation.js'} = 'blib/INTRANET_TMPL_DIR/prog/js/vue/dist/preservation.js';
|
||||
$file_map->{'koha-tmpl/intranet-tmpl/prog/js/vue/dist/admin/record_sources.js'} = 'blib/INTRANET_TMPL_DIR/prog/js/vue/dist/admin/record_sources.js';
|
||||
#OPAC_TMPL_DIR
|
||||
$file_map->{'koha-tmpl/opac-tmpl/bootstrap/css/opac.css'} = 'blib/OPAC_TMPL_DIR/bootstrap/css/opac.css';
|
||||
$file_map->{'koha-tmpl/opac-tmpl/bootstrap/css/opac-rtl.css'} = 'blib/OPAC_TMPL_DIR/bootstrap/css/opac-rtl.css';
|
||||
|
|
|
|||
|
|
@ -17,10 +17,12 @@
|
|||
|
||||
use Modern::Perl;
|
||||
|
||||
use Test::More tests => 1;
|
||||
use Test::More tests => 2;
|
||||
|
||||
use Koha::ERM::EUsage::UsageDataProvider;
|
||||
use Koha::Database;
|
||||
use Test::MockModule;
|
||||
use Test::MockObject;
|
||||
|
||||
use t::lib::TestBuilder;
|
||||
|
||||
|
|
@ -108,3 +110,53 @@ subtest '_build_url_query' => sub {
|
|||
$schema->storage->txn_rollback;
|
||||
|
||||
};
|
||||
|
||||
subtest 'test_connection() tests' => sub {
|
||||
|
||||
plan tests => 1;
|
||||
|
||||
$schema->storage->txn_begin;
|
||||
|
||||
my $ua = Test::MockModule->new('LWP::UserAgent');
|
||||
$ua->mock(
|
||||
'simple_request',
|
||||
sub {
|
||||
my $response = Test::MockObject->new();
|
||||
|
||||
$response->mock(
|
||||
'code',
|
||||
sub {
|
||||
return 200;
|
||||
}
|
||||
);
|
||||
$response->mock(
|
||||
'is_error',
|
||||
sub {
|
||||
return 0;
|
||||
}
|
||||
);
|
||||
$response->mock(
|
||||
'is_redirect',
|
||||
sub {
|
||||
return 0;
|
||||
}
|
||||
);
|
||||
$response->mock(
|
||||
'decoded_content',
|
||||
sub {
|
||||
return
|
||||
'{"Description":"COUNTER Usage Reports for Test platform.","ServiceActive":true,"RegistryURL":"https://www.whatever.com"}';
|
||||
}
|
||||
);
|
||||
$response->{_rc} = 200;
|
||||
return $response;
|
||||
}
|
||||
);
|
||||
|
||||
my $usage_data_provider = $builder->build_object(
|
||||
{ class => 'Koha::ERM::EUsage::UsageDataProviders', value => { name => 'TestProvider' } } );
|
||||
|
||||
is( $usage_data_provider->test_connection, 1 );
|
||||
|
||||
$schema->storage->txn_rollback;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
# along with Koha; if not, see <http://www.gnu.org/licenses>.
|
||||
|
||||
use Modern::Perl;
|
||||
use Encode;
|
||||
|
||||
use Test::More tests => 8;
|
||||
use Test::Exception;
|
||||
|
|
@ -680,7 +681,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
|
|||
MARC::Field->new('999', '', '', c => '1234567'),
|
||||
);
|
||||
|
||||
my $item_field = MARC::Field->new('952', '', '', o => '123456789123456789123456789', p => '123456789', z => 'test');
|
||||
my $item_field = MARC::Field->new('952', '', '', o => '123456789123456789123456789', p => '123456789', z => Encode::decode('UTF-8','To naprawdę bardzo długa notatka. Myślę, że będzie sprawiać kłopoty.'));
|
||||
my $items_count = 1638;
|
||||
while(--$items_count) {
|
||||
$large_marc_record->append_fields($item_field);
|
||||
|
|
|
|||
Loading…
Reference in New Issue