New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-29104: Impl. ImageAsset field type #2403

Merged
merged 4 commits into from Sep 11, 2018

Conversation

@adamwojs
Member

adamwojs commented Jul 25, 2018

Question Answer
JIRA issue EZP-29104
Bug/Improvement no
New feature yes
Target version master
BC breaks no
Tests pass yes
Doc needed yes

ImageAsset Field Type allows to store images in independent content items of a generic Image content type, in the media library, instead of storing them within the original content item to make then reusable accross system.

From the kernel POV its works as same as a ezobjetrelation field type.

ImageAsset Field Type configuration

ImageAsset Field Type allows to configure the following options:

Name Description Default value
content_type_identifier Content type used to store assets image
content_field_identifier Field identifier used to asset data image
name_field_identifier Field identifier used to asset name name
parent_location_id Location where the asset are created 51

Example configuration:

ezpublish:
    system:
       default:
            fieldtypes:
                ezimageasset:
                    content_type_identifier: photo
                    content_field_identifier: image
                    name_field_identifier: title
                    parent_location_id: 106

Customizing ImageAsset Field Type rendering

Internally the Image Asset Type is render via subrequest (similar to other relation types). Rendering customization is possible by configuring view type asset_image:

ezpublish:
    system:
       default:           
            content_view:
                asset_image:
                    default:
                        template: '::custom_image_asset_template.html.twig'
                        match: []

Generating image variation from the Image Asset

Thanks to the eZ\Bundle\EzPublishCoreBundle\Imagine\ImageAsset\AliasGenerator decorator it is possible to work with \eZ\Publish\SPI\Variation\VariationHandler in same way as with Image Field Type.

TODO:

  • Implement feature / fix a bug.
  • Implement tests.
  • Fix new code according to Coding Standards ($ composer fix-cs).
  • Ask for Code Review.
@ezrobot

This comment was marked as resolved.

Show comment
Hide comment
@ezrobot

ezrobot Jul 25, 2018

Contributor

Tool version : PHP CS Fixer 2.7.1 Sandy Pool by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/eZ/Publish/Core/FieldType/ImageAsset/Mapper.php b/eZ/Publish/Core/FieldType/ImageAsset/Mapper.php
index 51e7c8a..985291f 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/Mapper.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/Mapper.php
@@ -66,7 +66,7 @@ class Mapper
         $contentCreateStruct->setField($this->mappings['content_field_identifier'], $image);
 
         $contentDraft = $this->contentService->createContent($contentCreateStruct, [
-            $this->locationService->newLocationCreateStruct($this->mappings['parent_location_id'])
+            $this->locationService->newLocationCreateStruct($this->mappings['parent_location_id']),
         ]);
 
         return $this->contentService->publishVersion($contentDraft->versionInfo);
@@ -83,7 +83,7 @@ class Mapper
     public function getAssetField(Content $content): Field
     {
         if (!$this->isAsset($content)) {
-            throw new InvalidArgumentException("contentId", "Content {$content->id} is not a image asset!");
+            throw new InvalidArgumentException('contentId', "Content {$content->id} is not a image asset!");
         }
 
         return $content->getField($this->mappings['content_field_identifier']);
@@ -100,7 +100,7 @@ class Mapper
     public function getAssetValue(Content $content): ImageValue
     {
         if (!$this->isAsset($content)) {
-            throw new InvalidArgumentException("contentId", "Content {$content->id} is not a image asset!");
+            throw new InvalidArgumentException('contentId', "Content {$content->id} is not a image asset!");
         }
 
         return $content->getFieldValue($this->mappings['content_field_identifier']);
diff --git a/eZ/Publish/Core/FieldType/ImageAsset/Type.php b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
index c602ef3..3eff0a7 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/Type.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
@@ -70,7 +70,7 @@ class Type extends FieldType
 
     /**
      * Validates a field based on the validators in the field definition.
-     **
+     **.
      * @param \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDefinition The field definition of the field
      * @param \eZ\Publish\Core\FieldType\ImageAsset\Value $fieldValue The field value for which an action is performed
      *
@@ -93,7 +93,7 @@ class Type extends FieldType
                 'Content %type% is not a valid asset target',
                 null,
                 [
-                    '%type%' => $currentContentType->identifier
+                    '%type%' => $currentContentType->identifier,
                 ],
                 'destinationContentId'
             );
@@ -225,7 +225,7 @@ class Type extends FieldType
     public function toHash(SPIValue $value)
     {
         return [
-            'destinationContentId' => $value->destinationContentId
+            'destinationContentId' => $value->destinationContentId,
         ];
     }
 
diff --git a/eZ/Publish/Core/FieldType/ImageAsset/Value.php b/eZ/Publish/Core/FieldType/ImageAsset/Value.php
index 9742656..6d935e3 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/Value.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/Value.php
@@ -25,7 +25,7 @@ class Value extends BaseValue
     public function __construct($destinationContentId = null)
     {
         parent::__construct([
-            'destinationContentId' => $destinationContentId
+            'destinationContentId' => $destinationContentId,
         ]);
     }
 
diff --git a/eZ/Publish/Core/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php b/eZ/Publish/Core/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php
index 6ea4102..f1bb3e6 100644
--- a/eZ/Publish/Core/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php
+++ b/eZ/Publish/Core/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php
@@ -17,7 +17,6 @@ use eZ\Publish\Core\Helper\FieldHelper;
 use eZ\Publish\Core\Helper\TranslationHelper;
 use eZ\Publish\API\Repository\Values\Content\Content;
 use eZ\Publish\API\Repository\Values\Content\Field;
-use eZ\Publish\Core\MVC\ConfigResolverInterface;
 use Psr\Log\LoggerInterface;
 use Twig_Extension;
 use Twig_SimpleFunction;
@@ -99,7 +98,7 @@ class ContentExtension extends Twig_Extension
             new Twig_SimpleFunction(
                 'ez_first_filled_image_field_identifier',
                 array($this, 'getFirstFilledImageFieldIdentifier')
-            )
+            ),
         );
     }
 
Contributor

ezrobot commented Jul 25, 2018

Tool version : PHP CS Fixer 2.7.1 Sandy Pool by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/eZ/Publish/Core/FieldType/ImageAsset/Mapper.php b/eZ/Publish/Core/FieldType/ImageAsset/Mapper.php
index 51e7c8a..985291f 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/Mapper.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/Mapper.php
@@ -66,7 +66,7 @@ class Mapper
         $contentCreateStruct->setField($this->mappings['content_field_identifier'], $image);
 
         $contentDraft = $this->contentService->createContent($contentCreateStruct, [
-            $this->locationService->newLocationCreateStruct($this->mappings['parent_location_id'])
+            $this->locationService->newLocationCreateStruct($this->mappings['parent_location_id']),
         ]);
 
         return $this->contentService->publishVersion($contentDraft->versionInfo);
@@ -83,7 +83,7 @@ class Mapper
     public function getAssetField(Content $content): Field
     {
         if (!$this->isAsset($content)) {
-            throw new InvalidArgumentException("contentId", "Content {$content->id} is not a image asset!");
+            throw new InvalidArgumentException('contentId', "Content {$content->id} is not a image asset!");
         }
 
         return $content->getField($this->mappings['content_field_identifier']);
@@ -100,7 +100,7 @@ class Mapper
     public function getAssetValue(Content $content): ImageValue
     {
         if (!$this->isAsset($content)) {
-            throw new InvalidArgumentException("contentId", "Content {$content->id} is not a image asset!");
+            throw new InvalidArgumentException('contentId', "Content {$content->id} is not a image asset!");
         }
 
         return $content->getFieldValue($this->mappings['content_field_identifier']);
diff --git a/eZ/Publish/Core/FieldType/ImageAsset/Type.php b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
index c602ef3..3eff0a7 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/Type.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
@@ -70,7 +70,7 @@ class Type extends FieldType
 
     /**
      * Validates a field based on the validators in the field definition.
-     **
+     **.
      * @param \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDefinition The field definition of the field
      * @param \eZ\Publish\Core\FieldType\ImageAsset\Value $fieldValue The field value for which an action is performed
      *
@@ -93,7 +93,7 @@ class Type extends FieldType
                 'Content %type% is not a valid asset target',
                 null,
                 [
-                    '%type%' => $currentContentType->identifier
+                    '%type%' => $currentContentType->identifier,
                 ],
                 'destinationContentId'
             );
@@ -225,7 +225,7 @@ class Type extends FieldType
     public function toHash(SPIValue $value)
     {
         return [
-            'destinationContentId' => $value->destinationContentId
+            'destinationContentId' => $value->destinationContentId,
         ];
     }
 
diff --git a/eZ/Publish/Core/FieldType/ImageAsset/Value.php b/eZ/Publish/Core/FieldType/ImageAsset/Value.php
index 9742656..6d935e3 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/Value.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/Value.php
@@ -25,7 +25,7 @@ class Value extends BaseValue
     public function __construct($destinationContentId = null)
     {
         parent::__construct([
-            'destinationContentId' => $destinationContentId
+            'destinationContentId' => $destinationContentId,
         ]);
     }
 
diff --git a/eZ/Publish/Core/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php b/eZ/Publish/Core/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php
index 6ea4102..f1bb3e6 100644
--- a/eZ/Publish/Core/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php
+++ b/eZ/Publish/Core/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php
@@ -17,7 +17,6 @@ use eZ\Publish\Core\Helper\FieldHelper;
 use eZ\Publish\Core\Helper\TranslationHelper;
 use eZ\Publish\API\Repository\Values\Content\Content;
 use eZ\Publish\API\Repository\Values\Content\Field;
-use eZ\Publish\Core\MVC\ConfigResolverInterface;
 use Psr\Log\LoggerInterface;
 use Twig_Extension;
 use Twig_SimpleFunction;
@@ -99,7 +98,7 @@ class ContentExtension extends Twig_Extension
             new Twig_SimpleFunction(
                 'ez_first_filled_image_field_identifier',
                 array($this, 'getFirstFilledImageFieldIdentifier')
-            )
+            ),
         );
     }
 

@adamwojs adamwojs changed the title from [WIP] EZP-29104: Impl. ImageAsset field type to EZP-29104: Impl. ImageAsset field type Jul 27, 2018

Show outdated Hide outdated ...Bundle/DependencyInjection/Configuration/Parser/FieldType/ImageAsset.php
Show outdated Hide outdated eZ/Bundle/EzPublishCoreBundle/Imagine/ImageAsset/AliasGenerator.php
Show outdated Hide outdated eZ/Bundle/EzPublishCoreBundle/Imagine/ImageAsset/AliasGenerator.php
Show outdated Hide outdated ...ts/DependencyInjection/Configuration/Parser/FieldType/ImageAssetTest.php
class AliasGeneratorTest extends TestCase
{
/**
* @var \eZ\Bundle\EzPublishCoreBundle\Imagine\ImageAsset\AliasGenerator

This comment has been minimized.

@mikadamczyk

mikadamczyk Aug 1, 2018

Contributor

Should we use a single line or multiline for /** @var .... */ In this PR both are used

@mikadamczyk

mikadamczyk Aug 1, 2018

Contributor

Should we use a single line or multiline for /** @var .... */ In this PR both are used

Show outdated Hide outdated eZ/Publish/Core/FieldType/ImageAsset/Type.php
Show outdated Hide outdated eZ/Publish/Core/FieldType/Tests/ImageAsset/MapperTest.php
Show outdated Hide outdated eZ/Publish/Core/FieldType/Tests/ImageAsset/MapperTest.php
Show outdated Hide outdated eZ/Publish/Core/FieldType/Tests/ImageAsset/MapperTest.php
Show outdated Hide outdated eZ/Publish/Core/MVC/Symfony/Templating/Twig/Extension/ImageExtension.php
@alongosz

I'm sorry, but from my perspective it's impossible to review. Please at least separate implementation from tests (I mean by commits). Since we're gonna squash this, PR commits don't need to have an issue number. They need to be in past tense though.

git reset origin/master

is your friend.

@adamwojs

This comment has been minimized.

Show comment
Hide comment
@adamwojs

adamwojs Aug 2, 2018

Member

@alongosz I split PR into two separate commits as you requested: implementation and tests

Member

adamwojs commented Aug 2, 2018

@alongosz I split PR into two separate commits as you requested: implementation and tests

@ezrobot

This comment was marked as resolved.

Show comment
Hide comment
@ezrobot

ezrobot Aug 2, 2018

Contributor

Tool version : PHP CS Fixer 2.7.1 Sandy Pool by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/eZ/Publish/Core/FieldType/ImageAsset/Type.php b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
index 088b63d..587e4e4 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/Type.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
@@ -73,7 +73,7 @@ class Type extends FieldType
 
     /**
      * Validates a field based on the validators in the field definition.
-     **
+     **.
      * @param \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDefinition The field definition of the field
      * @param \eZ\Publish\Core\FieldType\ImageAsset\Value $fieldValue The field value for which an action is performed
      *
@@ -195,7 +195,7 @@ class Type extends FieldType
      *
      * @param \eZ\Publish\Core\FieldType\Relation\Value $value
      *
-     * @return boolean
+     * @return bool
      */
     protected function getSortInfo(BaseValue $value): bool
     {
Contributor

ezrobot commented Aug 2, 2018

Tool version : PHP CS Fixer 2.7.1 Sandy Pool by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/eZ/Publish/Core/FieldType/ImageAsset/Type.php b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
index 088b63d..587e4e4 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/Type.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
@@ -73,7 +73,7 @@ class Type extends FieldType
 
     /**
      * Validates a field based on the validators in the field definition.
-     **
+     **.
      * @param \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDefinition The field definition of the field
      * @param \eZ\Publish\Core\FieldType\ImageAsset\Value $fieldValue The field value for which an action is performed
      *
@@ -195,7 +195,7 @@ class Type extends FieldType
      *
      * @param \eZ\Publish\Core\FieldType\Relation\Value $value
      *
-     * @return boolean
+     * @return bool
      */
     protected function getSortInfo(BaseValue $value): bool
     {
@ezrobot

This comment was marked as resolved.

Show comment
Hide comment
@ezrobot

ezrobot Aug 2, 2018

Contributor

Tool version : PHP CS Fixer 2.7.1 Sandy Pool by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/eZ/Publish/Core/FieldType/ImageAsset/Type.php b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
index 0ecee19..587e4e4 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/Type.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
@@ -73,7 +73,7 @@ class Type extends FieldType
 
     /**
      * Validates a field based on the validators in the field definition.
-     **
+     **.
      * @param \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDefinition The field definition of the field
      * @param \eZ\Publish\Core\FieldType\ImageAsset\Value $fieldValue The field value for which an action is performed
      *
Contributor

ezrobot commented Aug 2, 2018

Tool version : PHP CS Fixer 2.7.1 Sandy Pool by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/eZ/Publish/Core/FieldType/ImageAsset/Type.php b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
index 0ecee19..587e4e4 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/Type.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
@@ -73,7 +73,7 @@ class Type extends FieldType
 
     /**
      * Validates a field based on the validators in the field definition.
-     **
+     **.
      * @param \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDefinition The field definition of the field
      * @param \eZ\Publish\Core\FieldType\ImageAsset\Value $fieldValue The field value for which an action is performed
      *
@ezrobot

This comment was marked as resolved.

Show comment
Hide comment
@ezrobot

ezrobot Aug 3, 2018

Contributor

Tool version : PHP CS Fixer 2.7.1 Sandy Pool by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/eZ/Publish/Core/FieldType/ImageAsset/Type.php b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
index 0ecee19..587e4e4 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/Type.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
@@ -73,7 +73,7 @@ class Type extends FieldType
 
     /**
      * Validates a field based on the validators in the field definition.
-     **
+     **.
      * @param \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDefinition The field definition of the field
      * @param \eZ\Publish\Core\FieldType\ImageAsset\Value $fieldValue The field value for which an action is performed
      *
Contributor

ezrobot commented Aug 3, 2018

Tool version : PHP CS Fixer 2.7.1 Sandy Pool by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/eZ/Publish/Core/FieldType/ImageAsset/Type.php b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
index 0ecee19..587e4e4 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/Type.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/Type.php
@@ -73,7 +73,7 @@ class Type extends FieldType
 
     /**
      * Validates a field based on the validators in the field definition.
-     **
+     **.
      * @param \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDefinition The field definition of the field
      * @param \eZ\Publish\Core\FieldType\ImageAsset\Value $fieldValue The field value for which an action is performed
      *
@adamwojs

This comment has been minimized.

Show comment
Hide comment
@adamwojs

adamwojs Aug 3, 2018

Member

PR ready for the final code review @alongosz @mikadamczyk

Member

adamwojs commented Aug 3, 2018

PR ready for the final code review @alongosz @mikadamczyk

*
* @return bool
*/
public function isSearchable(): bool

This comment has been minimized.

@mikadamczyk

mikadamczyk Aug 6, 2018

Contributor

This method is same as in parent class, so it is redundant

@mikadamczyk

mikadamczyk Aug 6, 2018

Contributor

This method is same as in parent class, so it is redundant

This comment has been minimized.

@alongosz

alongosz Aug 6, 2018

Member

This method is same as in parent class, so it is redundant

I'm sorry to disagree in this case. Relying on the fact that the current implementation of FieldType base core class returns false is risky. While we probably wouldn't change it for any minor version (though there's no BC promise for Core), it's going to be difficult to track in case of major version upgrade.

@alongosz

alongosz Aug 6, 2018

Member

This method is same as in parent class, so it is redundant

I'm sorry to disagree in this case. Relying on the fact that the current implementation of FieldType base core class returns false is risky. While we probably wouldn't change it for any minor version (though there's no BC promise for Core), it's going to be difficult to track in case of major version upgrade.

This comment has been minimized.

@adamwojs

adamwojs Aug 7, 2018

Member

I agree with @mikadamczyk

I'm sorry to disagree in this case. Relying on the fact that the current implementation of FieldType base core class returns false is risky.

Not in this case: \eZ\Publish\Core\FieldType\FieldType is the abstract class . If I cannot rely on methods inherited from it, then I should implement \eZ\Publish\SPI\FieldType\FieldType from scratch.

@adamwojs

adamwojs Aug 7, 2018

Member

I agree with @mikadamczyk

I'm sorry to disagree in this case. Relying on the fact that the current implementation of FieldType base core class returns false is risky.

Not in this case: \eZ\Publish\Core\FieldType\FieldType is the abstract class . If I cannot rely on methods inherited from it, then I should implement \eZ\Publish\SPI\FieldType\FieldType from scratch.

@ezrobot

This comment was marked as outdated.

Show comment
Hide comment
@ezrobot

ezrobot Aug 9, 2018

Contributor

Tool version : PHP CS Fixer 2.7.1 Sandy Pool by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php b/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php
index e8e1335..3c8d707 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php
@@ -66,7 +66,7 @@ class AssetMapper
      * Creates an Image Asset.
      *
      * @param string $name
-     * @param \eZ\Publish\Core\FieldType\Image\Value $image 
+     * @param \eZ\Publish\Core\FieldType\Image\Value $image
      * @param string $languageCode
      *
      * @return \eZ\Publish\API\Repository\Values\Content\Content
Contributor

ezrobot commented Aug 9, 2018

Tool version : PHP CS Fixer 2.7.1 Sandy Pool by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php b/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php
index e8e1335..3c8d707 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php
@@ -66,7 +66,7 @@ class AssetMapper
      * Creates an Image Asset.
      *
      * @param string $name
-     * @param \eZ\Publish\Core\FieldType\Image\Value $image 
+     * @param \eZ\Publish\Core\FieldType\Image\Value $image
      * @param string $languageCode
      *
      * @return \eZ\Publish\API\Repository\Values\Content\Content
@ezrobot

This comment was marked as outdated.

Show comment
Hide comment
@ezrobot

ezrobot Aug 9, 2018

Contributor

Tool version : PHP CS Fixer 2.7.1 Sandy Pool by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php b/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php
index e8e1335..3c8d707 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php
@@ -66,7 +66,7 @@ class AssetMapper
      * Creates an Image Asset.
      *
      * @param string $name
-     * @param \eZ\Publish\Core\FieldType\Image\Value $image 
+     * @param \eZ\Publish\Core\FieldType\Image\Value $image
      * @param string $languageCode
      *
      * @return \eZ\Publish\API\Repository\Values\Content\Content
Contributor

ezrobot commented Aug 9, 2018

Tool version : PHP CS Fixer 2.7.1 Sandy Pool by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php b/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php
index e8e1335..3c8d707 100644
--- a/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php
+++ b/eZ/Publish/Core/FieldType/ImageAsset/AssetMapper.php
@@ -66,7 +66,7 @@ class AssetMapper
      * Creates an Image Asset.
      *
      * @param string $name
-     * @param \eZ\Publish\Core\FieldType\Image\Value $image 
+     * @param \eZ\Publish\Core\FieldType\Image\Value $image
      * @param string $languageCode
      *
      * @return \eZ\Publish\API\Repository\Values\Content\Content
@adamwojs

This comment has been minimized.

Show comment
Hide comment
@adamwojs

adamwojs Aug 10, 2018

Member

PR updated according to @alongosz suggestions.

Member

adamwojs commented Aug 10, 2018

PR updated according to @alongosz suggestions.

@alongosz

+1, one nitpick, but fixing it won't affect behavior, so can be tested by QA

QA:
please try to see if you're able to use it in multisite environment with changed SiteAccess-aware config of this feature per SA (I suggest just parent_location_id).
I'm asking for it because there are known issues when injecting dynamic parameters from SA config resolver.

$contentService: '@ezpublish.api.service.content'
$locationService: '@ezpublish.api.service.location'
$contentTypeService: '@ezpublish.api.service.content_type'
$mappings: '$fieldtypes.ezimageasset.mappings$'

This comment has been minimized.

@alongosz

alongosz Aug 10, 2018

Member

Since the setting is introduced on Bundle level, here you should rather have some core fallback. It will also allow you to avoid overriding service in test yamls.

@alongosz

alongosz Aug 10, 2018

Member

Since the setting is introduced on Bundle level, here you should rather have some core fallback. It will also allow you to avoid overriding service in test yamls.

@barbaragr barbaragr self-assigned this Aug 22, 2018

@barbaragr

Ready to merge @alongosz :)

@alongosz alongosz merged commit 4892d15 into ezsystems:master Sep 11, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment