Skip to content

Commit

Permalink
refs vufind-org#2999 handle nullable result set id - initializing to …
Browse files Browse the repository at this point in the history
…null and concat to empty string
  • Loading branch information
RLangeUni committed Oct 18, 2024
1 parent 8cba230 commit 46b2f01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion module/VuFind/src/VuFind/View/Helper/Root/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -868,11 +868,13 @@ protected function deduplicateLinks($links)
*/
public function getUniqueHtmlElementId($idPrefix = '')
{
$resultSetId = $this->driver->getResultSetIdentifier() ?? '';

return preg_replace(
"/\s+/",
'_',
($idPrefix ? $idPrefix . '-' : '')
. $this->driver->getResultSetIdentifier() . '-'
. ($resultSetId ? $resultSetId . '-' : '')
. $this->driver->getUniqueId()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ abstract public function getRecordCollectionFactory();
protected function injectSourceIdentifier(RecordCollectionInterface $response)
{
$response->setSourceIdentifiers($this->identifier);
$response->setResultSetIdentifier($this->generateUuid());

if (count($response->getRecords()) > 0) {
// TODO: Replace custom UUID generation with Doctrine
// UUID generator once available (after the merge of #2233)
$response->setResultSetIdentifier($this->generateUuid());
}

return $response;
}
Expand Down

0 comments on commit 46b2f01

Please sign in to comment.