Skip to content

Commit 9bda467

Browse files
committed
Revert some breaking changes
1 parent 75cd839 commit 9bda467

File tree

4 files changed

+12
-19
lines changed

4 files changed

+12
-19
lines changed

ImportExport/DataConverter/ProductPriceDataConverter.php

+9-7
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,21 @@ protected function getHeaderConversionRules()
5858
];
5959
}
6060

61-
/**
62-
* @return PriceList
63-
*/
64-
public function getDefaultPriceList()
61+
public function getDefaultPriceList(): ?PriceList
6562
{
63+
$defaultPriceListId = $this->getDefaultPriceListId();
64+
if (!$defaultPriceListId) {
65+
return null;
66+
}
67+
6668
return $this->doctrineHelper
6769
->getEntityManagerForClass(PriceList::class)
6870
->getRepository(PriceList::class)
69-
->findOneBy(['default' => true]);
71+
->find($defaultPriceListId);
7072
}
7173

72-
public function getDefaultPriceListId(): int
74+
public function getDefaultPriceListId(): ?int
7375
{
74-
return $this->getDefaultPriceList()->getId();
76+
return $this->configManager->get('oro_pricing.default_price_list');
7577
}
7678
}

ImportExport/Processor/ProductImageImportProcessor.php

-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Oro\Bundle\AkeneoBundle\ImportExport\Processor;
44

5-
use Oro\Bundle\AttachmentBundle\Entity\File;
65
use Oro\Bundle\BatchBundle\Item\Support\ClosableInterface;
76
use Oro\Bundle\IntegrationBundle\ImportExport\Processor\StepExecutionAwareImportProcessor;
87
use Oro\Bundle\ProductBundle\Entity\Product;
@@ -83,14 +82,6 @@ private function mergeImages(Product $product, array $images): Product
8382
continue;
8483
}
8584

86-
if (!is_a($image->getImage()->getParentEntityClass(), ProductImage::class, true)) {
87-
$image->setImage(new File());
88-
89-
$product->removeImage($image);
90-
91-
continue;
92-
}
93-
9485
$filename = $image->getImage()->getOriginalFilename();
9586
if (!in_array($filename, array_keys($images))) {
9687
$product->removeImage($image);

Layout/DataProvider/FileApplicationsDataProvider.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Oro\Bundle\AttachmentBundle\Layout\DataProvider\FileApplicationsDataProvider as BaseFileApplicationsDataProvider;
66
use Oro\Bundle\EntityConfigBundle\Provider\ConfigProvider;
77

8-
class FileApplicationsDataProvider
8+
class FileApplicationsDataProvider extends BaseFileApplicationsDataProvider
99
{
1010
/** @var BaseFileApplicationsDataProvider */
1111
private $applicationsDataProvider;
@@ -34,6 +34,6 @@ public function isValidForField(string $className, string $fieldName): bool
3434

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

37-
return $config->get('visible');
37+
return $config->get('is_displayable');
3838
}
3939
}

Resources/config/services.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ services:
176176
decorates: oro_attachment.layout.data_provider.file_applications
177177
arguments:
178178
- '@oro_akeneo.layout.data_provider.file_applications.inner'
179-
- '@oro_entity_config.provider.attachment'
179+
- '@oro_entity_config.provider.frontend'
180180

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

0 commit comments

Comments
 (0)