Skip to content

Commit

Permalink
Merge pull request #1559 from NatLibFi/fix-guessvocabulary-no-urispace
Browse files Browse the repository at this point in the history
fix guessVocabularyFromURI when some vocabulary has no URI space
  • Loading branch information
osma authored Nov 23, 2023
2 parents 88c2c78 + a82e9a4 commit a08b033
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion model/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,10 @@ public function guessVocabularyFromURI($uri, $preferredVocabId = null)
if ($this->vocabsByUriSpace === null) { // initialize cache
$this->vocabsByUriSpace = array();
foreach ($this->getVocabularies() as $voc) {
$this->vocabsByUriSpace[$voc->getUriSpace()][] = $voc;
$uriSpace = $voc->getUriSpace();
if ($uriSpace) {
$this->vocabsByUriSpace[$uriSpace][] = $voc;
}
}
}

Expand Down

0 comments on commit a08b033

Please sign in to comment.