From 37ed52185e11ec35c4a42cc7c53cc5bca07a805d Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Wed, 9 Oct 2024 15:16:57 +0200 Subject: [PATCH] Set `objectID` for `context` --- .../builder/field/FileProcessorFormField.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wcfsetup/install/files/lib/system/form/builder/field/FileProcessorFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/FileProcessorFormField.class.php index 0e2808100b..2588f18967 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/FileProcessorFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/FileProcessorFormField.class.php @@ -5,6 +5,7 @@ use wcf\data\file\File; use wcf\data\file\FileList; use wcf\data\file\thumbnail\FileThumbnailList; +use wcf\data\IStorableObject; use wcf\system\file\processor\FileProcessor; use wcf\system\file\processor\IFileProcessor; use wcf\system\form\builder\data\processor\CustomFormDataProcessor; @@ -104,6 +105,16 @@ function (IFormDocument $document, array $parameters) { return $this; } + #[\Override] + public function updatedObject(array $data, IStorableObject $object, $loadValues = true) + { + if ($loadValues) { + $this->context['objectID'] = $object->{$object::getDatabaseTableIndexName()}; + } + + return parent::updatedObject($data, $object, $loadValues); + } + public function getFileProcessor(): IFileProcessor { return $this->getObjectType()->getProcessor();