Skip to content

Commit

Permalink
DC, QDC: Check also namespaced recordID before adding one.
Browse files Browse the repository at this point in the history
  • Loading branch information
EreMaijala committed Oct 5, 2023
1 parent c6cca65 commit c98e891
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/RecordManager/Base/Record/Dc.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ public function setData($source, $oaiID, $data)
{
$this->XmlTraitSetData($source, $oaiID, $data);

if (empty($this->doc->recordID)) {
if (
empty($this->doc->recordID)
&& empty($this->doc->children('http://www.openarchives.org/OAI/2.0/oai_dc/')->recordID)
) {
$p = strpos($oaiID, ':');
$p = strpos($oaiID, ':', $p + 1);
$this->doc->addChild('recordID', substr($oaiID, $p + 1));
Expand Down
5 changes: 4 additions & 1 deletion src/RecordManager/Base/Record/Qdc.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ public function setData($source, $oaiID, $data)
{
$this->XmlTraitSetData($source, $oaiID, $data);

if (empty($this->doc->recordID)) {
if (
empty($this->doc->recordID)
&& empty($this->doc->children('http://www.openarchives.org/OAI/2.0/oai_dc/')->recordID)
) {
$p = strpos($oaiID, ':');
$p = strpos($oaiID, ':', $p + 1);
$this->doc->addChild('recordID', substr($oaiID, $p + 1));
Expand Down

0 comments on commit c98e891

Please sign in to comment.