Skip to content

Commit

Permalink
FIX: When receiving assets, store the corresponding resource
Browse files Browse the repository at this point in the history
This fixes files not being stored when using the ImageUpload for example.
  • Loading branch information
Benjamin-K committed Jun 21, 2021
1 parent fb319de commit 805500c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Classes/Finishers/DatabaseStorageFinisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Neos\Flow\Annotations as Flow;
use Neos\Form\Core\Model\AbstractFinisher;
use Neos\Form\Exception\FinisherException;
use Neos\Media\Domain\Model\AssetInterface;

use Wegmeister\DatabaseStorage\Domain\Model\DatabaseStorage;
use Wegmeister\DatabaseStorage\Domain\Repository\DatabaseStorageRepository;
Expand Down Expand Up @@ -47,6 +48,12 @@ protected function executeInternal()
$formRuntime = $this->finisherContext->getFormRuntime();
$formValues = $formRuntime->getFormState()->getFormValues();

foreach ($formValues as &$formValue) {
if ($formValue instanceof AssetInterface) {
$formValue = $formValue->getResource();
}
}

$identifier = $this->parseOption('identifier');
if (!$identifier) {
$identifier = '__undefined__';
Expand Down

0 comments on commit 805500c

Please sign in to comment.