Skip to content

Commit

Permalink
EZP-32128: Variations hrefs no longer generated for removed image ass…
Browse files Browse the repository at this point in the history
…et relation (#59)
  • Loading branch information
ViniTou authored Nov 12, 2020
1 parent 40fc35e commit 5f55165
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/FieldTypeProcessor/ImageAssetFieldTypeProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace EzSystems\EzPlatformRest\FieldTypeProcessor;

use eZ\Publish\API\Repository\ContentService;
use eZ\Publish\API\Repository\Exceptions\NotFoundException;
use EzSystems\EzPlatformRest\FieldTypeProcessor;
use Symfony\Component\Routing\RouterInterface;

Expand Down Expand Up @@ -48,7 +49,11 @@ public function postProcessValueHash($outgoingValueHash)
return $outgoingValueHash;
}

$imageContent = $this->contentService->loadContent((int) $outgoingValueHash['destinationContentId']);
try {
$imageContent = $this->contentService->loadContent((int) $outgoingValueHash['destinationContentId']);
} catch (NotFoundException $e) {
return $outgoingValueHash;
}

$field = $imageContent->getField($this->configMappings['content_field_identifier']);

Expand Down

0 comments on commit 5f55165

Please sign in to comment.