Skip to content

Commit

Permalink
Fix KNP empty translations still persisted 2 (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chakroun Yesser authored and webda2l committed Jun 20, 2019
1 parent dcf0716 commit 9b31840
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Form/EventListener/TranslationsFormsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public function submit(FormEvent $event): void

foreach ($data as $locale => $translation) {
// Remove useless Translation object
if (empty($translation)) {
if ((method_exists($translation, 'isEmpty') && $translation->isEmpty()) // Knp
|| empty($translation) // Default
) {
$data->removeElement($translation);
continue;
}
Expand Down

0 comments on commit 9b31840

Please sign in to comment.