You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting the following error with PHP 8.2 and the following request: ?verb=ListRecords&metadataPrefix=oai_dc&from=2023-01-15T00:00:00Z&until=2023-01-25T23:59:59Z
The error is:
stderr: Stack trace:
stderr: #0 /oai/Classes/Server.php(292): array_sum(false)
stderr: #1 /oai/Classes/Server.php(187): OCC\\OAI2\\Server->checkDateFormat('2023-01-15T00:0...')
stderr: #2 [internal function]: OCC\\OAI2\\Server->ListRecords()
stderr: #3 /oai/Classes/Server.php(56): call_user_func(Array)
stderr: #4 /oai/index.php(73): OCC\\OAI2\\Server->__construct('...', Array, Array, Array, Array)
stderr: #5 {main}
stderr: thrown in /oai/Classes/Server.php on line 292
stderr: PHP Fatal error: Uncaught TypeError: array_sum(): Argument #1 ($array) must be of type array, bool given in /oai/Classes/Server.php:292
Getting the following error with PHP 8.2 and the following request:
?verb=ListRecords&metadataPrefix=oai_dc&from=2023-01-15T00:00:00Z&until=2023-01-25T23:59:59Z
The error is:
I looked at the code in Server.php, line 292 here:
https://github.com/opencultureconsulting/oai_pmh/blob/master/Classes/Server.php#L292
The docs for "getLastErrors()" say that in case there are no errors a boolean is returned:
https://www.php.net/manual/en/datetime.getlasterrors.php
I changed my copy of the code as follows and it is working now:
I can provide a pull request but I am not that familiar with PHP so I am not sure if this is a real bug.
The text was updated successfully, but these errors were encountered: