Skip to content

Commit b457298

Browse files
committed
Do not clear the mass import form if errors appeared
1 parent 319ac40 commit b457298

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Controller/AdminPages/BaseAdminController.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,15 @@ protected function _new(Request $request, EntityManagerInterface $em, EntityImpo
380380
}
381381
$em->flush();
382382

383-
if (count($results) > 0) {
383+
if (count($created_count) > 0) {
384384
$this->addFlash('success', t('entity.mass_creation_flash', ['%COUNT%' => $created_count]));
385385
}
386386

387-
//Recreate mass creation form, so we get the updated parent list and empty lines
388-
$mass_creation_form = $this->createForm(MassCreationForm::class, ['entity_class' => $this->entity_class]);
387+
if (count($errors)) {
388+
//Recreate mass creation form, so we get the updated parent list and empty lines
389+
$mass_creation_form = $this->createForm(MassCreationForm::class, ['entity_class' => $this->entity_class]);
390+
}
391+
389392
}
390393

391394
return $this->render($this->twig_template, [

0 commit comments

Comments
 (0)