- throw OaiModelException if no metadata prefix is defined (ListRecords)

- composer updates
- new version of manual
This commit is contained in:
Arno Kaimbacher 2020-07-28 09:22:28 +02:00
parent 9d736aa2b7
commit 385ae20a1b
3 changed files with 24 additions and 15 deletions

View File

@ -378,10 +378,10 @@ class RequestController extends Controller
$reldocIds = array();
$metadataPrefix = null;
if (true === array_key_exists('metadataPrefix', $oaiRequest)) {
$metadataPrefix = $oaiRequest['metadataPrefix'];
}
$this->proc->setParameter('', 'oai_metadataPrefix', $metadataPrefix);
// if (true === array_key_exists('metadataPrefix', $oaiRequest)) {
// $metadataPrefix = $oaiRequest['metadataPrefix'];
// }
// $this->proc->setParameter('', 'oai_metadataPrefix', $metadataPrefix);
$tokenWorker = new ResumptionTokens();
$tokenWorker->setResumptionPath($tokenTempPath);
@ -405,6 +405,16 @@ class RequestController extends Controller
// else no resumptionToken is given
} else {
// no resumptionToken is given
if (true === array_key_exists('metadataPrefix', $oaiRequest)) {
$metadataPrefix = $oaiRequest['metadataPrefix'];
} else {
throw new OaiModelException(
'The prefix of the metadata argument is unknown.',
OaiModelError::BADARGUMENT
);
}
$this->proc->setParameter('', 'oai_metadataPrefix', $metadataPrefix);
$finder = Dataset::query();
// add server state restrictions
$finder->whereIn('server_state', $this->deliveringDocumentStates);
@ -491,7 +501,6 @@ class RequestController extends Controller
);
}
}
$totalIds = $finder->count();
$reldocIds = $finder->orderBy('publish_id')->pluck('publish_id')->toArray();

20
composer.lock generated
View File

@ -746,16 +746,16 @@
},
{
"name": "laravel/framework",
"version": "v6.18.26",
"version": "v6.18.31",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "d11b6168c65251ffa81ae0dfaf017ad2f30013da"
"reference": "a731824421f9ebc586728ea9c7cff231a249aaa9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/d11b6168c65251ffa81ae0dfaf017ad2f30013da",
"reference": "d11b6168c65251ffa81ae0dfaf017ad2f30013da",
"url": "https://api.github.com/repos/laravel/framework/zipball/a731824421f9ebc586728ea9c7cff231a249aaa9",
"reference": "a731824421f9ebc586728ea9c7cff231a249aaa9",
"shasum": ""
},
"require": {
@ -890,7 +890,7 @@
"framework",
"laravel"
],
"time": "2020-07-21T14:25:39+00:00"
"time": "2020-07-27T18:23:18+00:00"
},
{
"name": "laravel/tinker",
@ -1364,16 +1364,16 @@
},
{
"name": "nesbot/carbon",
"version": "2.36.1",
"version": "2.37.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "ee7378a36cc62952100e718bcc58be4c7210e55f"
"reference": "1f61206de973d67f36ce50f041c792ddac663c3e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/ee7378a36cc62952100e718bcc58be4c7210e55f",
"reference": "ee7378a36cc62952100e718bcc58be4c7210e55f",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/1f61206de973d67f36ce50f041c792ddac663c3e",
"reference": "1f61206de973d67f36ce50f041c792ddac663c3e",
"shasum": ""
},
"require": {
@ -1449,7 +1449,7 @@
"type": "tidelift"
}
],
"time": "2020-07-04T12:29:56+00:00"
"time": "2020-07-28T06:04:54+00:00"
},
{
"name": "nikic/php-parser",

Binary file not shown.