mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-03 05:55:16 +01:00
Fixed exception when mass creation of non structural entities failed.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user