Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into 2.4-develop
  • Loading branch information
mage-os-ci committed Nov 19, 2024
2 parents b0e1ab7 + 915e8fe commit 4cafc44
Show file tree
Hide file tree
Showing 249 changed files with 961 additions and 367 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/AdminAnalytics/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/framework": "*",
"magento/module-backend": "*",
"magento/module-config": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdminNotification/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"lib-libxml": "*",
"magento/framework": "*",
"magento/module-backend": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdvancedPricingImportExport/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/framework": "*",
"magento/module-catalog": "*",
"magento/module-catalog-import-export": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdvancedSearch/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"magento/module-customer": "*",
"magento/module-search": "*",
"magento/module-store": "*",
"php": "~8.1.0||~8.2.0||~8.3.0"
"php": "~8.2.0||~8.3.0"
},
"type": "magento2-module",
"license": [
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Amqp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"magento/framework": "*",
"magento/framework-amqp": "*",
"magento/framework-message-queue": "*",
"php": "~8.1.0||~8.2.0||~8.3.0"
"php": "~8.2.0||~8.3.0"
},
"type": "magento2-module",
"license": [
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Analytics/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-analytics",
"description": "N/A",
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/module-backend": "*",
"magento/module-config": "*",
"magento/module-integration": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
},
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/framework": "*"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
},
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/framework": "*",
"magento/module-application-performance-monitor": "*",
"magento/module-new-relic-reporting": "*"
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AsyncConfig/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-async-config",
"description": "N/A",
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/framework": "*",
"magento/module-config": "*"
},
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AsynchronousOperations/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"magento/module-authorization": "*",
"magento/module-backend": "*",
"magento/module-ui": "*",
"php": "~8.1.0||~8.2.0||~8.3.0"
"php": "~8.2.0||~8.3.0"
},
"suggest": {
"magento/module-admin-notification": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Authorization/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/framework": "*",
"magento/module-backend": "*"
},
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AwsS3/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/framework": "*",
"magento/module-remote-storage": "*"
},
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/framework": "*",
"magento/module-backup": "*",
"magento/module-catalog": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backup/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/framework": "*",
"magento/module-backend": "*",
"magento/module-cron": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/framework": "*",
"magento/module-backend": "*",
"magento/module-catalog": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/BundleGraphQl/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "N/A",
"type": "magento2-module",
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/module-catalog": "*",
"magento/module-bundle": "*",
"magento/module-catalog-graph-ql": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/BundleImportExport/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/framework": "*",
"magento/module-bundle": "*",
"magento/module-store": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CacheInvalidate/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/framework": "*",
"magento/module-page-cache": "*"
},
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Captcha/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/framework": "*",
"magento/module-backend": "*",
"magento/module-checkout": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CardinalCommerce/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"php": "~8.2.0||~8.3.0",
"magento/framework": "*",
"magento/module-checkout": "*",
"magento/module-payment": "*",
Expand Down
27 changes: 12 additions & 15 deletions app/code/Magento/Catalog/Model/Product/Price/PricePersistence.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2016 Adobe
* All Rights Reserved.
*/

namespace Magento\Catalog\Model\Product\Price;
Expand All @@ -10,6 +10,7 @@
use Magento\Catalog\Api\ProductAttributeRepositoryInterface;
use Magento\Catalog\Model\ProductIdLocatorInterface;
use Magento\Catalog\Model\ResourceModel\Attribute;
use Magento\Catalog\Model\ResourceModel\Product\Price\BasePriceFactory;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\EntityManager\MetadataPool;
use Magento\Framework\Exception\CouldNotDeleteException;
Expand Down Expand Up @@ -88,14 +89,16 @@ class PricePersistence
* @param MetadataPool $metadataPool
* @param string $attributeCode
* @param DateTime|null $dateTime
* @param BasePriceFactory|null $basePriceFactory
*/
public function __construct(
Attribute $attributeResource,
ProductAttributeRepositoryInterface $attributeRepository,
ProductIdLocatorInterface $productIdLocator,
MetadataPool $metadataPool,
$attributeCode = '',
?DateTime $dateTime = null
?DateTime $dateTime = null,
private ?BasePriceFactory $basePriceFactory = null
) {
$this->attributeResource = $attributeResource;
$this->attributeRepository = $attributeRepository;
Expand All @@ -104,6 +107,8 @@ public function __construct(
$this->metadataPool = $metadataPool;
$this->dateTime = $dateTime ?: ObjectManager::getInstance()
->get(DateTime::class);
$this->basePriceFactory = $this->basePriceFactory ?: ObjectManager::getInstance()
->get(BasePriceFactory::class);
}

/**
Expand Down Expand Up @@ -134,21 +139,13 @@ public function get(array $skus)
public function update(array $prices)
{
array_walk($prices, function (&$price) {
return $price['attribute_id'] = $this->getAttributeId();
return $price['attribute_id'] = (int)$this->getAttributeId();
});
$connection = $this->attributeResource->getConnection();
$connection->beginTransaction();

$basePrice = $this->basePriceFactory->create(['attributeId' => (int)$this->getAttributeId()]);
try {
foreach (array_chunk($prices, $this->itemsPerOperation) as $pricesBunch) {
$this->attributeResource->getConnection()->insertOnDuplicate(
$this->attributeResource->getTable($this->table),
$pricesBunch,
['value']
);
}
$connection->commit();
$basePrice->update($prices);
} catch (\Exception $e) {
$connection->rollBack();
throw new CouldNotSaveException(
__('Could not save Prices.'),
$e
Expand Down
Loading

0 comments on commit 4cafc44

Please sign in to comment.