Skip to content

Commit

Permalink
Set objectID for context
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyperghost committed Oct 9, 2024
1 parent 13c2a35 commit 37ed521
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 37ed521

Please sign in to comment.