Bugzilla – Attachment 69998 Details for
Bug 19725
OAI-PMH ListRecords and ListIdentifiers should use biblio_metadata.timestamp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19725: OAI-PMH - Use biblio_metadata.timestamp
Bug-19725-OAI-PMH---Use-bibliometadatatimestamp.patch (text/plain), 3.67 KB, created by
Kyle M Hall (khall)
on 2017-12-21 11:19:21 UTC
(
hide
)
Description:
Bug 19725: OAI-PMH - Use biblio_metadata.timestamp
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2017-12-21 11:19:21 UTC
Size:
3.67 KB
patch
obsolete
>From 085a561b58bc16100ae29802c96f15eb1f61f0ae Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 1 Dec 2017 15:21:56 +0000 >Subject: [PATCH] Bug 19725: OAI-PMH - Use biblio_metadata.timestamp > >Since bug 17196, biblioitems.timestamp is not always updated after a >change in the MARC record. >Filtering should be based on biblio_metadata.timestamp instead. > >Test plan: >1. prove t/db_dependent/OAI/Server.t >2. Verify that it SUCCEEDS > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/OAI/Server/ListBase.pm | 6 +++--- > t/db_dependent/OAI/Server.t | 14 +------------- > 2 files changed, 4 insertions(+), 16 deletions(-) > >diff --git a/Koha/OAI/Server/ListBase.pm b/Koha/OAI/Server/ListBase.pm >index 0c7c56a..92af1c3 100644 >--- a/Koha/OAI/Server/ListBase.pm >+++ b/Koha/OAI/Server/ListBase.pm >@@ -58,7 +58,7 @@ sub GetRecords { > # first deleted records ($deleted == 1), then normal records ($deleted == 0) > STAGELOOP: > for ( ; $deleted >= 0; $deleted-- ) { >- my $table = $deleted ? 'deletedbiblioitems' : 'biblioitems'; >+ my $table = $deleted ? 'deletedbiblio_metadata' : 'biblio_metadata'; > my $sql = " > SELECT biblionumber > FROM $table >@@ -103,7 +103,7 @@ sub GetRecords { > $sql = " > SELECT MAX(timestamp) > FROM ( >- SELECT timestamp FROM deletedbiblioitems WHERE biblionumber = ? >+ SELECT timestamp FROM deletedbiblio_metadata WHERE biblionumber = ? > UNION > SELECT timestamp FROM deleteditems WHERE biblionumber = ? > ) bis >@@ -112,7 +112,7 @@ sub GetRecords { > $sql = " > SELECT MAX(timestamp) > FROM ( >- SELECT timestamp FROM biblioitems WHERE biblionumber = ? >+ SELECT timestamp FROM biblio_metadata WHERE biblionumber = ? > UNION > SELECT timestamp FROM deleteditems WHERE biblionumber = ? > UNION >diff --git a/t/db_dependent/OAI/Server.t b/t/db_dependent/OAI/Server.t >index fa2d2a7..def867b 100644 >--- a/t/db_dependent/OAI/Server.t >+++ b/t/db_dependent/OAI/Server.t >@@ -85,7 +85,6 @@ foreach my $index ( 0 .. NUMBER_OF_MARC_RECORDS - 1 ) { > $sth->execute($biblionumber); > my $timestamp = $sth->fetchrow_array . 'Z'; > $timestamp =~ s/ /T/; >- $timestamp = manipulate_timestamp( $index, $biblionumber, $timestamp ); > $record = GetMarcBiblio({ biblionumber => $biblionumber }); > $record = XMLin($record->as_xml_record); > push @header, { datestamp => $timestamp, identifier => "TEST:$biblionumber" }; >@@ -353,6 +352,7 @@ subtest 'Bug 19725: OAI-PMH ListRecords and ListIdentifiers should use biblio_me > my $record = GetMarcBiblio({biblionumber => $biblionumber}); > $record->append_fields(MARC::Field->new(999, '', '', z => '_')); > ModBiblio($record, $biblionumber); >+ $oaidc[0]->{header}->{datestamp} = $from; > > test_query( > 'ListRecords oai_dc with parameter from', >@@ -364,15 +364,3 @@ subtest 'Bug 19725: OAI-PMH ListRecords and ListIdentifiers should use biblio_me > }; > > $schema->storage->txn_rollback; >- >-sub manipulate_timestamp { >-# This eliminates waiting a few seconds in order to get a higher timestamp >-# Works only for 60 records.. >- my ( $index, $bibno, $timestamp ) = @_; >- return $timestamp if $timestamp !~ /\d{2}Z/; >- my $secs = sprintf( "%02d", $index ); >- $timestamp =~ s/\d{2}Z/${secs}Z/; >- $dbh->do("UPDATE biblioitems SET timestamp=? WHERE biblionumber=?", undef, >- ( $timestamp, $bibno )); >- return $timestamp; >-} >-- >2.10.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19725
:
69437
|
69438
|
69627
|
69628
|
69997
| 69998