From 54bce41e97f07763254a95db222f5c65b432c8ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20MANIER?= Date: Fri, 13 Jun 2025 16:16:49 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20Deleting=20a=20file=20from=20a=20?= =?UTF-8?q?=E2=80=9Cform.File=E2=80=9D=20field=20does=20not=20work.=20#658?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/admin/controller/edit.go | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/admin/controller/edit.go b/plugins/admin/controller/edit.go index 825ca8724..bd8a56bba 100644 --- a/plugins/admin/controller/edit.go +++ b/plugins/admin/controller/edit.go @@ -163,6 +163,7 @@ func (h *Handler) EditForm(ctx *context.Context) { param.MultiForm.Value[formPanel.FieldList[i].Field] = []string{""} } if formPanel.FieldList[i].FormType == form.File && + len(param.MultiForm.File[formPanel.FieldList[i].Field]) != 0 && len(param.MultiForm.Value[formPanel.FieldList[i].Field+"__change_flag"]) > 0 && param.MultiForm.Value[formPanel.FieldList[i].Field+"__change_flag"][0] != "1" { delete(param.MultiForm.Value, formPanel.FieldList[i].Field)