diff --git a/src/RecordManager/Base/Record/Qdc.php b/src/RecordManager/Base/Record/Qdc.php index 6931227f9..2eee74e50 100644 --- a/src/RecordManager/Base/Record/Qdc.php +++ b/src/RecordManager/Base/Record/Qdc.php @@ -66,6 +66,13 @@ class Qdc extends AbstractRecord */ protected $db; + /** + * Record namespace identifier + * + * @var string + */ + protected $recordNs = 'http://www.openarchives.org/OAI/2.0/oai_dc/'; + /** * Constructor * @@ -105,7 +112,7 @@ public function setData($source, $oaiID, $data) if ( empty($this->doc->recordID) - && empty($this->doc->children('http://www.openarchives.org/OAI/2.0/oai_dc/')->recordID) + && empty($this->doc->children($this->recordNs)->recordID) ) { $parts = explode(':', $oaiID); $id = ('oai' === $parts[0] && !empty($parts[2])) ? $parts[2] : $oaiID; @@ -120,7 +127,11 @@ public function setData($source, $oaiID, $data) */ public function getID() { - return trim((string)$this->doc->recordID[0]); + $id = (string)$this->doc->recordID[0]; + if ('' === $id) { + $id = (string)$this->doc->children($this->recordNs)->recordID[0]; + } + return trim($id); } /**