diff --git a/application/editor/models/ConceptValidator/UniquePrefLabelInScheme.php b/application/editor/models/ConceptValidator/UniquePrefLabelInScheme.php index de24a44f9..e8359360d 100644 --- a/application/editor/models/ConceptValidator/UniquePrefLabelInScheme.php +++ b/application/editor/models/ConceptValidator/UniquePrefLabelInScheme.php @@ -52,7 +52,16 @@ public function isValid(Editor_Models_Concept $concept, $extraData) } elseif (null !== ($tenant = OpenSKOS_Db_Table_Tenants::fromIdentity())) { $query .= ' tenant:' . $tenant->code; } - $query .= ' collection:"' . $concept['collection'] . '"'; + + if (isset($concept['collection'])) { + $collection = $concept['collection']; + } elseif (isset($extraData['collection'])) { + $collection = $extraData['collection']; + } else { + throw new \Exception('Can not determine concept\'s collection.'); + } + + $query .= ' collection:"' . $collection . '"'; $query .= ' -uuid:"' . $concept['uuid'] . '"'; $response = Api_Models_Concepts::factory()->setQueryParams(array('rows' => 0))->getConcepts($query);