Skip to content
Permalink
Browse files

fix: clean alias when publishing content as the focuspoint might have…

… changed

Signed-off-by: Florian ALEXANDRE <f.alexandre@novactive.com>
  • Loading branch information...
florianalexandre committed Feb 15, 2019
1 parent 3b6e226 commit 2e14c441cb74b80a6907067f3e381d9d23c7ab1e
@@ -1,7 +1,6 @@
services:
ezpublish.field_type.enhancedimage.external_storage:
Novactive\EzEnhancedImageAsset\FieldType\EnhancedImage\EnhancedImageStorage:
parent: ezpublish.fieldType.ezimage.externalStorage
class: "%ezpublish.fieldType.ezimage.externalStorage.class%"
tags:
- {name: ezpublish.fieldType.externalStorageHandler, alias: enhancedimage}

@@ -0,0 +1,29 @@
<?php
/**
* NovaeZEnhancedImageAssetBundle.
*
* @package NovaeZEnhancedImageAssetBundle
*
* @author Novactive <f.alexandre@novactive.com>
* @copyright 2018 Novactive
* @license https://github.com/Novactive/NovaeZEnhancedImageAssetBundle/blob/master/LICENSE
*/
namespace Novactive\EzEnhancedImageAsset\FieldType\EnhancedImage;
use eZ\Publish\Core\FieldType\Image\ImageStorage;
use eZ\Publish\SPI\Persistence\Content\Field;
use eZ\Publish\SPI\Persistence\Content\VersionInfo;
class EnhancedImageStorage extends ImageStorage
{
public function storeFieldData(VersionInfo $versionInfo, Field $field, array $context)
{
$result = parent::storeFieldData($versionInfo, $field, $context);
if (isset($field->value->data['path']) && $this->aliasCleaner) {
$this->aliasCleaner->removeAliases($field->value->data['path']);
}
return $result;
}
}

0 comments on commit 2e14c44

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.