Skip to content

Commit

Permalink
Merge pull request #6013 from WoltLab/file-processor-object-id
Browse files Browse the repository at this point in the history
Set `objectID` for `context`
  • Loading branch information
Cyperghost authored Oct 9, 2024
2 parents 7c355dc + 37ed521 commit 83d2f3e
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 83d2f3e

Please sign in to comment.