From 42ee2086ee2c04196d2c1244ba14f4ff1d93d722 Mon Sep 17 00:00:00 2001 From: enured <enis.nuredini@uzh.ch> Date: Wed, 27 Dec 2023 17:48:45 +0100 Subject: [PATCH] B17519: Filepond downloadButton behaviour corrected if no parameter is given. refs #17519 --- extension/Classes/Core/AbstractBuildForm.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extension/Classes/Core/AbstractBuildForm.php b/extension/Classes/Core/AbstractBuildForm.php index a64753fd0..ed76fb314 100644 --- a/extension/Classes/Core/AbstractBuildForm.php +++ b/extension/Classes/Core/AbstractBuildForm.php @@ -3126,7 +3126,10 @@ abstract class AbstractBuildForm { // Check for upload type new or old and initialize json config for new upload type $jsonConfig = array(); $preloadedFiles = ''; - $formElement[FE_FILE_DOWNLOAD_BUTTON] = $formElement[FE_FILE_DOWNLOAD_BUTTON] ?? ''; + $downloadButton = $formElement[FE_FILE_DOWNLOAD_BUTTON] ?? false; + if ($downloadButton) { + $downloadButton = substr($this->evaluate->parse($formElement[FE_FILE_DOWNLOAD_BUTTON]), 2); + } $jsonConfig[UPLOAD_MIME_TYPE_ACCEPT] = $formElement[FE_FILE_MIME_TYPE_ACCEPT] ?? null; $jsonConfig[UPLOAD_MAX_FILE_SIZE] = $arr[FE_FILE_MAX_FILE_SIZE] ?? null; $jsonConfig[UPLOAD_MULTI_UPLOAD] = false; @@ -3141,7 +3144,7 @@ abstract class AbstractBuildForm { $jsonConfig[UPLOAD_ID] = 1; $jsonConfig[UPLOAD_GROUP_ID] = $groupId ?? 0; $jsonConfig[UPLOAD_DROP_BACKGROUND] = 'white'; - $jsonConfig[UPLOAD_DOWNLOAD_BUTTON] = substr($this->evaluate->parse($formElement[FE_FILE_DOWNLOAD_BUTTON]), 2); + $jsonConfig[UPLOAD_DOWNLOAD_BUTTON] = $downloadButton; $jsonConfig[UPLOAD_TYPE_FORM] = true; $jsonConfig[UPLOAD_FORM_ID] = $formElement[FE_HTML_ID]; $jsonConfig[UPLOAD_SIP_DOWNLOAD_KEY] = $sipDownloadKey; -- GitLab