@@ -, +, @@ - Fix QA. --- installer/data/mysql/sysprefs.sql | 4 ++-- .../en/modules/admin/preferences/web_services.pref | 1 + opac/oai.pl | 28 ++++++++++------------ 3 files changed, 15 insertions(+), 18 deletions(-) --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -232,6 +232,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OAI-PMH:archiveID','KOHA-OAI-TEST',NULL,'OAI-PMH archive identification','Free'), ('OAI-PMH:AutoUpdateSets','0','','Automatically update OAI sets when a bibliographic record is created or updated','YesNo'), ('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'), +('OAI-PMH:DeletedRecord','persistent','Koha\'s deletedbiblio table will never be deleted (persistent), might be deleted (transient), or will never have any data in it (no)','transient|persistent|no','Choice') ('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'), ('OCLCAffiliateID','','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','free'), ('OPACAcquisitionDetails','0','','Show the acquisition details at the OPAC','YesNo'), @@ -479,6 +480,5 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'), ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'), ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), -('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), -('OAI-PMH:DeletedRecord','persistent','Koha\'s deletedbiblio table will never be deleted (persistent) or might be deleted (transient)','transient|persistent','Choice') +('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo') ; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref @@ -33,6 +33,7 @@ Web services: choices: persistent: will never be emptied or truncated (persistent) transient: might be emptied or truncated at some point (transient) + no: will never have any data in it (no) - "." ILS-DI: - --- a/opac/oai.pl +++ a/opac/oai.pl @@ -254,8 +254,7 @@ sub new { package C4::OAI::DeletedRecord; -use strict; -use warnings; +use Modern::Perl; use HTTP::OAI; use HTTP::OAI::Metadata::OAI_DC; @@ -300,23 +299,20 @@ sub new { my $self = HTTP::OAI::GetRecord->new(%args); my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare(" - SELECT marcxml, timestamp - FROM biblioitems - WHERE biblionumber=? " ); my $prefix = $repository->{koha_identifier} . ':'; my ($biblionumber) = $args{identifier} =~ /^$prefix(.*)/; - $sth->execute( $biblionumber ); my ($marcxml, $timestamp); my $deleted = 0; - unless ( ($marcxml, $timestamp) = $sth->fetchrow ) { - $sth = $dbh->prepare(" - SELECT biblionumber, timestamp - FROM deletedbiblio - WHERE biblionumber=? " ); - $sth->execute( $biblionumber ); + unless ( ($marcxml, $timestamp) = $dbh->selectrow_array(q/ + SELECT marcxml, timestamp + FROM biblioitems + WHERE biblionumber=? /, undef, $biblionumber)) { + + unless ( ($marcxml, $timestamp) = $dbh->selectrow_array(q/ + SELECT biblionumber, timestamp + FROM deletedbiblio + WHERE biblionumber=? /, undef, $biblionumber )) { - unless ( ($marcxml, $timestamp) = $sth->fetchrow ) { return HTTP::OAI::Response->new( requestURL => $repository->self_url(), @@ -370,7 +366,7 @@ sub new { } my $max = $repository->{koha_max_count}; my $sql = " - (SELECT biblioitems.biblionumber, timestamp + (SELECT biblioitems.biblionumber, biblioitems.timestamp FROM biblioitems "; $sql .= " JOIN oai_sets_biblios ON biblioitems.biblionumber = oai_sets_biblios.biblionumber " if defined $set; @@ -535,7 +531,7 @@ sub new { } my $max = $repository->{koha_max_count}; my $sql = " - (SELECT biblioitems.biblionumber, marcxml, timestamp + (SELECT biblioitems.biblionumber, biblioitems.marcxml, biblioitems.timestamp FROM biblioitems "; $sql .= " JOIN oai_sets_biblios ON biblioitems.biblionumber = oai_sets_biblios.biblionumber " if defined $set; --