mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +02:00
Fixed exception when mass creation of non structural entities failed.
This commit is contained in:
parent
3a9a6bbe76
commit
d804184073
2 changed files with 10 additions and 6 deletions
|
@ -368,7 +368,11 @@ abstract class BaseAdminController extends AbstractController
|
||||||
|
|
||||||
//Show errors to user:
|
//Show errors to user:
|
||||||
foreach ($errors as $error) {
|
foreach ($errors as $error) {
|
||||||
|
if ($error['entity'] instanceof AbstractStructuralDBElement) {
|
||||||
$this->addFlash('error', $error['entity']->getFullPath().':'.$error['violations']);
|
$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
|
//Persist valid entities to DB
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue