diff --git a/ImportExport/DataConverter/ProductPriceDataConverter.php b/ImportExport/DataConverter/ProductPriceDataConverter.php index eb2ac3b6..45f0e114 100644 --- a/ImportExport/DataConverter/ProductPriceDataConverter.php +++ b/ImportExport/DataConverter/ProductPriceDataConverter.php @@ -58,19 +58,21 @@ protected function getHeaderConversionRules() ]; } - /** - * @return PriceList - */ - public function getDefaultPriceList() + public function getDefaultPriceList(): ?PriceList { + $defaultPriceListId = $this->getDefaultPriceListId(); + if (!$defaultPriceListId) { + return null; + } + return $this->doctrineHelper ->getEntityManagerForClass(PriceList::class) ->getRepository(PriceList::class) - ->findOneBy(['default' => true]); + ->find($defaultPriceListId); } - public function getDefaultPriceListId(): int + public function getDefaultPriceListId(): ?int { - return $this->getDefaultPriceList()->getId(); + return $this->configManager->get('oro_pricing.default_price_list'); } } diff --git a/ImportExport/Processor/ProductImageImportProcessor.php b/ImportExport/Processor/ProductImageImportProcessor.php index 297f61e5..c34624b5 100644 --- a/ImportExport/Processor/ProductImageImportProcessor.php +++ b/ImportExport/Processor/ProductImageImportProcessor.php @@ -2,7 +2,6 @@ namespace Oro\Bundle\AkeneoBundle\ImportExport\Processor; -use Oro\Bundle\AttachmentBundle\Entity\File; use Oro\Bundle\BatchBundle\Item\Support\ClosableInterface; use Oro\Bundle\IntegrationBundle\ImportExport\Processor\StepExecutionAwareImportProcessor; use Oro\Bundle\ProductBundle\Entity\Product; @@ -83,14 +82,6 @@ private function mergeImages(Product $product, array $images): Product continue; } - if (!is_a($image->getImage()->getParentEntityClass(), ProductImage::class, true)) { - $image->setImage(new File()); - - $product->removeImage($image); - - continue; - } - $filename = $image->getImage()->getOriginalFilename(); if (!in_array($filename, array_keys($images))) { $product->removeImage($image); diff --git a/Layout/DataProvider/FileApplicationsDataProvider.php b/Layout/DataProvider/FileApplicationsDataProvider.php index fbb70f05..82bf1d7f 100644 --- a/Layout/DataProvider/FileApplicationsDataProvider.php +++ b/Layout/DataProvider/FileApplicationsDataProvider.php @@ -5,7 +5,7 @@ use Oro\Bundle\AttachmentBundle\Layout\DataProvider\FileApplicationsDataProvider as BaseFileApplicationsDataProvider; use Oro\Bundle\EntityConfigBundle\Provider\ConfigProvider; -class FileApplicationsDataProvider +class FileApplicationsDataProvider extends BaseFileApplicationsDataProvider { /** @var BaseFileApplicationsDataProvider */ private $applicationsDataProvider; @@ -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'); } } diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 16448ade..d881b537 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -176,7 +176,7 @@ services: decorates: oro_attachment.layout.data_provider.file_applications arguments: - '@oro_akeneo.layout.data_provider.file_applications.inner' - - '@oro_entity_config.provider.attachment' + - '@oro_entity_config.provider.frontend' oro_akeneo.layout.block_type.attribute_group: class: 'Oro\Bundle\AkeneoBundle\Layout\Block\Type\AttributeGroupType'