From 9da98b041e3b557591109aae1de087b1ea7347af Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Thu, 12 Oct 2017 10:14:05 +0200 Subject: [PATCH] Fix bug in ListIdentifiers --- oai2server.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/oai2server.php b/oai2server.php index 434858f..a61cc47 100644 --- a/oai2server.php +++ b/oai2server.php @@ -214,9 +214,11 @@ class OAI2Server { } $records = call_user_func($this->listRecordsCallback, $metadataPrefix, $this->formatTimestamp($from), $this->formatTimestamp($until), false, $deliveredRecords, $maxItems); foreach ($records as $record) { - $cur_record = $this->response->addToVerbNode('record'); + if ($this->verb == 'ListRecords') { // for ListIdentifiers, only headers will be returned. + $cur_record = $this->response->addToVerbNode('record'); + } $cur_header = $this->response->createHeader($record['identifier'], $this->formatDatestamp($record['timestamp']), $record['deleted'], $cur_record); - if (!$record['deleted'] && $this->verb == 'ListRecords') { // for ListIdentifiers, only identifiers will be returned. + if (!$record['deleted'] && $this->verb == 'ListRecords') { // for ListIdentifiers, only headers will be returned. $this->addMetadata($cur_record, $record['metadata']); } }