From 6df08a0418d9c515a8745be84f313c05145482f8 Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 12 Sep 2018 19:00:52 +0000 Subject: [PATCH] Bug 10662: Incorrect conditions cause incorrect messages and missing links Signed-off-by: Ed Veal --- C4/Context.pm | 2 +- Koha/OAI/Harvester/Import/Record.pm | 3 ++- .../prog/en/modules/tools/oai-pmh-harvester/dashboard.tt | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index 35231d7..0376cd0 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -777,7 +777,7 @@ sub triplestore { my $triplestore = ( $context->{triplestore} && $context->{triplestore}->{$name} ) ? $context->{triplestore}->{$name} : undef; if ( ! $triplestore ){ my $config_file = $context->config('triplestore_config'); - if ( -f $config_file ){ + if ( $config_file && -f $config_file ){ my $config = YAML::LoadFile($config_file); if ($config && $name){ my $new_triplestore = $self->_new_triplestore($config,$name); diff --git a/Koha/OAI/Harvester/Import/Record.pm b/Koha/OAI/Harvester/Import/Record.pm index 6f2b545..f0ad3d5 100755 --- a/Koha/OAI/Harvester/Import/Record.pm +++ b/Koha/OAI/Harvester/Import/Record.pm @@ -319,7 +319,8 @@ sub import_record { rdf_type => $rdf_type, #NOTE: RDF }); - if ($import_record->isa('Koha::Import::MARCXML')){ + #FIXME: This is too hard-coded... + if ($import_record->isa('Koha::OAI::Harvester::Import::MARCXML')){ if ($linked_id){ #Link Koha record ID to OAI-PMH details for this record type, #if linkage doesn't already exist. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/dashboard.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/dashboard.tt index 5e4e3c4..3f6d174 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/dashboard.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/dashboard.tt @@ -141,7 +141,7 @@
- [% IF ( result.start.defined ) %] + [% IF ( result.defined("start") ) %]
[% IF ( result.start ) %] Start succeeded @@ -149,7 +149,7 @@ Start failed [% END %]
- [% ELSIF ( result.stop.defined ) %] + [% ELSIF ( result.defined("stop") ) %]
[% IF ( result.stop ) %] Stop succeeded @@ -157,7 +157,7 @@ Stop failed [% END %]
- [% ELSIF ( result.delete.defined ) %] + [% ELSIF ( result.defined("delete") ) %]
[% IF ( result.delete ) %] Delete succeeded -- 2.1.4