From 6192a3ee9eac37163500dc569a334102478999f5 Mon Sep 17 00:00:00 2001 From: Ramon Bartl Date: Mon, 22 Jun 2026 16:23:03 +0200 Subject: [PATCH] Set multipart enctype on the sample header form so file uploads persist The senaite-sampleheader-form declares method='post' without enctype='multipart/form-data', so any AT FileField rendered inline in the header table posts as a filename string instead of a real FileUpload. The widget's process_form then sees a string, finds no .filename attribute, and silently treats the field as empty - the file disappears on save even though the rest of the form submit succeeds. Setting the enctype matches what every other Plone form with file inputs does (base_edit, AR Add, attachments) and lets custom widgets like ExtFileField extensions on AnalysisRequest roundtrip through the sample header form correctly. --- CHANGES.rst | 1 + src/senaite/core/browser/viewlets/templates/sampleheader.pt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index a8cfa264a8..9ed1ba9ecd 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,7 @@ Changelog 2.7.0 (unreleased) ------------------ +- #2960 Set multipart enctype on the sample header form so file uploads persist - #2953 Fix IClientAwareMixin interface mismatch breaking client access on DX content - #2955 Defer workflow transition lookup with a React content-menu component - #2954 Declare i18n:domain on duration widget templates diff --git a/src/senaite/core/browser/viewlets/templates/sampleheader.pt b/src/senaite/core/browser/viewlets/templates/sampleheader.pt index db44dcdba7..3d25d70b55 100644 --- a/src/senaite/core/browser/viewlets/templates/sampleheader.pt +++ b/src/senaite/core/browser/viewlets/templates/sampleheader.pt @@ -29,7 +29,8 @@
+ method="post" novalidate + enctype="multipart/form-data">