Do not clear the mass import form if errors appeared

This commit is contained in:
Jan Böhmer 2025-12-07 21:33:41 +01:00
parent 319ac406a8
commit b457298152

View file

@ -380,14 +380,17 @@ abstract class BaseAdminController extends AbstractController
}
$em->flush();
if (count($results) > 0) {
if (count($created_count) > 0) {
$this->addFlash('success', t('entity.mass_creation_flash', ['%COUNT%' => $created_count]));
}
if (count($errors)) {
//Recreate mass creation form, so we get the updated parent list and empty lines
$mass_creation_form = $this->createForm(MassCreationForm::class, ['entity_class' => $this->entity_class]);
}
}
return $this->render($this->twig_template, [
'entity' => $new_entity,
'form' => $form,