From 907fc18ff73134be9a62b2b75f736ecec594f449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Fri, 7 Jun 2019 16:59:51 +0200 Subject: [PATCH] Override translations _destroy value depending of our translations managment logic During any translatable resource edit, if you remove all translations you will be redirected to same form with errors showing you one of persisted but marked to destroy translations, without this patch _destroy field value wil be true and you will no able to persist without re-addding the same language through translation interface. --- app/helpers/translatable_form_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/helpers/translatable_form_helper.rb b/app/helpers/translatable_form_helper.rb index cfe37e490..458c7a929 100644 --- a/app/helpers/translatable_form_helper.rb +++ b/app/helpers/translatable_form_helper.rb @@ -38,6 +38,7 @@ module TranslatableFormHelper @template.content_tag :div, translations_options(translations_form.object, locale) do @template.concat translations_form.hidden_field( :_destroy, + value: !@template.enabled_locale?(translations_form.object.globalized_model, locale), data: { locale: locale } )