Skip to content
Snippets Groups Projects
Commit a29fac94 authored by Robert Lange's avatar Robert Lange
Browse files

refs #17811 [fid] handle empty publication details in OrderHydrator

* prevent notices when publication details are empty
* prevent fidis notice / error when issn in getPublishedIn is null
** set array with empty string instead
parent eb0706cb
No related merge requests found
...@@ -32,7 +32,8 @@ class OrderHydrator extends AbstractHydrator { ...@@ -32,7 +32,8 @@ class OrderHydrator extends AbstractHydrator {
/* Collect needed record data */ /* Collect needed record data */
$id = $driver->tryMethod('getUniqueID'); $id = $driver->tryMethod('getUniqueID');
$title = $driver->tryMethod('getTitle'); $title = $driver->tryMethod('getTitle');
$publicationDetails = $this->toArray( $driver->tryMethod('getPublicationDetails')[0] ); $pdetails = $driver->tryMethod('getPublicationDetails');
$publicationDetails = $this->toArray(!empty($pdetails) ? $pdetails[0] : null);
$authors = $driver->tryMethod('getDeduplicatedAuthors'); $authors = $driver->tryMethod('getDeduplicatedAuthors');
$primaryAuthor = $driver->tryMethod('getPrimaryAuthor'); $primaryAuthor = $driver->tryMethod('getPrimaryAuthor');
$secondaryAuthors = $driver->tryMethod('getSecondaryAuthors'); $secondaryAuthors = $driver->tryMethod('getSecondaryAuthors');
...@@ -49,6 +50,10 @@ class OrderHydrator extends AbstractHydrator { ...@@ -49,6 +50,10 @@ class OrderHydrator extends AbstractHydrator {
? $publishedIn['issue'] : implode(', ', $publishedIn['issue']); ? $publishedIn['issue'] : implode(', ', $publishedIn['issue']);
} }
if (empty($publishedIn['issns'])) {
$publishedIn['issns'] = [""];
}
$record = compact( $record = compact(
'id', 'id',
'title', 'title',
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment