Skip to content

Commit

Permalink
Backport #85 by @sylvainraye
Browse files Browse the repository at this point in the history
  • Loading branch information
dxops committed May 17, 2023
1 parent 166f6ab commit 6ca50e4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
/**
* Postpone segments updates
*/
class ProductCollectionVariantReindexMessageSendListenerDecorator extends BaseListener implements
AdditionalOptionalListenerInterface
class ProductCollectionVariantReindexMessageSendListenerDecorator extends BaseListener implements AdditionalOptionalListenerInterface
{
use AdditionalOptionalListenerTrait;

Expand Down
8 changes: 0 additions & 8 deletions ImportExport/Processor/ProductImageImportProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@ private function mergeImages(Product $product, array $images): Product
continue;
}

if (!is_a($image->getImage()->getParentEntityClass(), ProductImage::class, true)) {
$image->setImage(null);

$product->removeImage($image);

continue;
}

$filename = $image->getImage()->getOriginalFilename();
if (!in_array($filename, array_keys($images))) {
$product->removeImage($image);
Expand Down
7 changes: 5 additions & 2 deletions ImportExport/Writer/AttributeWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,11 @@ protected function setAttributeData(FieldConfigModel $fieldConfigModel)
$attributeConfig->set('visible', false);
$attributeConfig->set('enabled', false);

$attributeConfig->set('is_global', false);
$attributeConfig->set('organization_id', $this->getOrganizationId());
// Differentiate OroCommerce EE from CE
if (class_exists('\Oro\Bundle\EntityConfigProBundle\Attribute\AttributeConfigurationProvider')) {
$attributeConfig->set('is_global', false);
$attributeConfig->set('organization_id', $this->getOrganizationId());
}
}

$attributeConfig->set('field_name', $fieldName);
Expand Down
2 changes: 1 addition & 1 deletion Layout/DataProvider/FileApplicationsDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public function isValidForField(string $className, string $fieldName): bool

$config = $this->configProvider->getConfig($className, $fieldName);

return $config->get('visible');
return $config->get('is_displayable');
}
}
2 changes: 1 addition & 1 deletion Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ services:
decorates: oro_attachment.layout.data_provider.file_applications
arguments:
- '@oro_akeneo.layout.data_provider.file_applications.inner'
- '@oro_entity_config.provider.attribute'
- '@oro_entity_config.provider.frontend'

oro_akeneo.layout.block_type.attribute_group:
class: 'Oro\Bundle\AkeneoBundle\Layout\Block\Type\AttributeGroupType'
Expand Down

0 comments on commit 6ca50e4

Please sign in to comment.