Skip to content

Commit

Permalink
Fix KNP empty translations still persisted (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
Phenix789 authored and webda2l committed Oct 4, 2018
1 parent 5473871 commit dcf0716
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Form/EventListener/TranslationsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,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 dcf0716

Please sign in to comment.