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

View file

@ -175,12 +175,12 @@
</fieldset>
</div>
<div id="mass_creation" class="tab-pane fade">
<div class="row">
<p class="text-muted offset-sm-3 col-sm-9">{% trans %}mass_creation.help{% endtrans %}</p>
<div id="mass_creation" class="tab-pane fade">
<div class="row">
<p class="text-muted offset-sm-3 col-sm-9">{% trans %}mass_creation.help{% endtrans %}</p>
</div>
{{ form(mass_creation_form) }}
</div>
{{ form(mass_creation_form) }}
</div>
{% endif %}