Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Add check for collection when checking for pref label. refs #27415
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandar Mitsev committed Jun 27, 2016
1 parent 144788c commit bbf6079
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bbf6079

Please sign in to comment.