Skip to content
Snippets Groups Projects
Commit a03cb3c9 authored by damjan's avatar damjan
Browse files

[BUGFIX] Check if the name of the edited type is unique

parent 60c55574
No related branches found
No related tags found
No related merge requests found
......@@ -102,6 +102,19 @@ class TsrefController extends \TYPO3\Flow\Mvc\Controller\ActionController {
if ($theType->getParent() === -1) {
$theType->setParent(NULL);
}
// Check if the type is unique
$theTypeIsUnique = FALSE;
try {
$this->tsrefRestService->getTypeByUrlName($theType->getUrlName());
} catch (\Exception $notExist) {
if ($notExist->getCode() === 404) {
$theTypeIsUnique = TRUE;
}
}
if (!$theTypeIsUnique) {
throw new \RuntimeException('The name of the type must be unique.');
}
if ($editForm) {
$result = $this->tsrefRestService->editAttribute($theType);
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment