Fixed exception when mass creation of non structural entities failed.

This commit is contained in:
Jan Böhmer 2023-02-03 23:27:49 +01:00
parent 3a9a6bbe76
commit d804184073
2 changed files with 10 additions and 6 deletions

View file

@ -368,7 +368,11 @@ abstract class BaseAdminController extends AbstractController
//Show errors to user:
foreach ($errors as $error) {
$this->addFlash('error', $error['entity']->getFullPath().':'.$error['violations']);
if ($error['entity'] instanceof AbstractStructuralDBElement) {
$this->addFlash('error', $error['entity']->getFullPath().':'.$error['violations']);
} else { //When we dont have a structural element, we can only show the name
$this->addFlash('error', $error['entity']->getName().':'.$error['violations']);
}
}
//Persist valid entities to DB