Skip to content

Commit

Permalink
Revert some breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dxops committed May 17, 2023
1 parent 75cd839 commit 9bda467
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
16 changes: 9 additions & 7 deletions ImportExport/DataConverter/ProductPriceDataConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
9 changes: 0 additions & 9 deletions ImportExport/Processor/ProductImageImportProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions Layout/DataProvider/FileApplicationsDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down 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 @@ -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'
Expand Down

0 comments on commit 9bda467

Please sign in to comment.