Skip to content

Commit 3808c33

Browse files
committed
MC-13613: Product mass update
1 parent b2c4a00 commit 3808c33

File tree

2 files changed

+12
-4
lines changed
  • app/code/Magento/Catalog

2 files changed

+12
-4
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribut
4242
*/
4343
private $userContext;
4444

45+
/**
46+
* @var int
47+
*/
48+
private $bulkSize;
49+
4550
/**
4651
* @param Action\Context $context
4752
* @param \Magento\Catalog\Helper\Product\Edit\Action\Attribute $attributeHelper
@@ -50,6 +55,7 @@ class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribut
5055
* @param \Magento\Framework\DataObject\IdentityGeneratorInterface $identityService
5156
* @param \Magento\Framework\Serialize\SerializerInterface $serializer
5257
* @param \Magento\Authorization\Model\UserContextInterface $userContext
58+
* @param int $bulkSize
5359
*/
5460
public function __construct(
5561
Action\Context $context,
@@ -58,14 +64,16 @@ public function __construct(
5864
\Magento\AsynchronousOperations\Api\Data\OperationInterfaceFactory $operartionFactory,
5965
\Magento\Framework\DataObject\IdentityGeneratorInterface $identityService,
6066
\Magento\Framework\Serialize\SerializerInterface $serializer,
61-
\Magento\Authorization\Model\UserContextInterface $userContext
67+
\Magento\Authorization\Model\UserContextInterface $userContext,
68+
int $bulkSize = 100
6269
) {
6370
parent::__construct($context, $attributeHelper);
6471
$this->bulkManagement = $bulkManagement;
6572
$this->operationFactory = $operartionFactory;
6673
$this->identityService = $identityService;
6774
$this->serializer = $serializer;
6875
$this->userContext = $userContext;
76+
$this->bulkSize = $bulkSize;
6977
}
7078

7179
/**
@@ -171,9 +179,9 @@ private function publish(
171179
$websiteId,
172180
$productIds
173181
):void {
174-
$productIdsChunks = array_chunk($productIds, 100);
182+
$productIdsChunks = array_chunk($productIds, $this->bulkSize);
175183
$bulkUuid = $this->identityService->generateId();
176-
$bulkDescription = __('Update attributes to ' . count($productIds) . ' selected products');
184+
$bulkDescription = __('Update attributes for ' . count($productIds) . ' selected products');
177185
$operations = [];
178186
foreach ($productIdsChunks as $productIdsChunk) {
179187
if ($websiteRemoveData || $websiteAddData) {

app/code/Magento/Catalog/Model/Attribute/Backend/Consumer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function process(\Magento\AsynchronousOperations\Api\Data\OperationInterf
110110
) {
111111
$status = OperationInterface::STATUS_TYPE_RETRIABLY_FAILED;
112112
$errorCode = $e->getCode();
113-
$message = __($e->getMessage());
113+
$message = $e->getMessage();
114114
} else {
115115
$status = OperationInterface::STATUS_TYPE_NOT_RETRIABLY_FAILED;
116116
$errorCode = $e->getCode();

0 commit comments

Comments
 (0)