Skip to content

Commit ff4fcff

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into MCP-954
2 parents a740a90 + e304792 commit ff4fcff

File tree

73 files changed

+2642
-383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2642
-383
lines changed

app/code/Magento/Captcha/composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
"magento/module-sales": "*",
1414
"magento/module-store": "*",
1515
"magento/module-authorization": "*",
16-
"laminas/laminas-captcha": "^2.11.0",
17-
"laminas/laminas-db": "^2.13.4",
18-
"laminas/laminas-session": "^2.12.1"
16+
"laminas/laminas-captcha": "^2.12",
17+
"laminas/laminas-db": "^2.13.4"
1918
},
2019
"type": "magento2-module",
2120
"license": [

app/code/Magento/Catalog/Controller/Adminhtml/Product/MassStatus.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Framework\Controller\ResultFactory;
1313
use Magento\Ui\Component\MassAction\Filter;
1414
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
15+
use Magento\Catalog\Helper\Product\Edit\Action\Attribute as AttributeHelper;
1516

1617
/**
1718
* Updates status for a batch of products.
@@ -41,27 +42,36 @@ class MassStatus extends \Magento\Catalog\Controller\Adminhtml\Product implement
4142
*/
4243
private $productAction;
4344

45+
/**
46+
* @var AttributeHelper
47+
*/
48+
private $attributeHelper;
49+
4450
/**
4551
* @param \Magento\Backend\App\Action\Context $context
4652
* @param Builder $productBuilder
4753
* @param \Magento\Catalog\Model\Indexer\Product\Price\Processor $productPriceIndexerProcessor
4854
* @param Filter $filter
4955
* @param CollectionFactory $collectionFactory
5056
* @param \Magento\Catalog\Model\Product\Action $productAction
57+
* @param AttributeHelper $attributeHelper
5158
*/
5259
public function __construct(
5360
\Magento\Backend\App\Action\Context $context,
5461
Product\Builder $productBuilder,
5562
\Magento\Catalog\Model\Indexer\Product\Price\Processor $productPriceIndexerProcessor,
5663
Filter $filter,
5764
CollectionFactory $collectionFactory,
58-
\Magento\Catalog\Model\Product\Action $productAction = null
65+
\Magento\Catalog\Model\Product\Action $productAction = null,
66+
AttributeHelper $attributeHelper = null
5967
) {
6068
$this->filter = $filter;
6169
$this->collectionFactory = $collectionFactory;
6270
$this->_productPriceIndexerProcessor = $productPriceIndexerProcessor;
6371
$this->productAction = $productAction ?: ObjectManager::getInstance()
6472
->get(\Magento\Catalog\Model\Product\Action::class);
73+
$this->attributeHelper = $attributeHelper ?: ObjectManager::getInstance()
74+
->get(AttributeHelper::class);
6575
parent::__construct($context, $productBuilder);
6676
}
6777

@@ -93,6 +103,7 @@ public function execute()
93103
{
94104
$collection = $this->filter->getCollection($this->collectionFactory->create());
95105
$productIds = $collection->getAllIds();
106+
$this->attributeHelper->setProductIds($productIds);
96107
$requestStoreId = $storeId = $this->getRequest()->getParam('store', null);
97108
$filterRequest = $this->getRequest()->getParam('filters', null);
98109
$status = (int) $this->getRequest()->getParam('status');

app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@ abstract class AbstractAction
2929
/**
3030
* Chunk size
3131
*/
32-
const RANGE_CATEGORY_STEP = 500;
32+
public const RANGE_CATEGORY_STEP = 500;
3333

3434
/**
3535
* Chunk size for product
3636
*/
37-
const RANGE_PRODUCT_STEP = 1000000;
37+
public const RANGE_PRODUCT_STEP = 1000000;
3838

3939
/**
4040
* Catalog category index table name
4141
*/
42-
const MAIN_INDEX_TABLE = 'catalog_category_product_index';
42+
public const MAIN_INDEX_TABLE = 'catalog_category_product_index';
4343

4444
/**
4545
* Suffix for table to show it is temporary
4646
* @deprecated see getIndexTable
4747
*/
48-
const TEMPORARY_TABLE_SUFFIX = '_tmp';
48+
public const TEMPORARY_TABLE_SUFFIX = '_tmp';
4949

5050
/**
5151
* Cached non anchor categories select by store id
@@ -582,7 +582,7 @@ protected function createAnchorSelect(Store $store)
582582
'category_id' => 'cc.entity_id',
583583
'product_id' => 'ccp.product_id',
584584
'position' => new \Zend_Db_Expr(
585-
$this->connection->getIfNullSql('ccp2.position', 'ccp.position + 10000')
585+
$this->connection->getIfNullSql('ccp2.position', 'MIN(ccp.position) + 10000')
586586
),
587587
'is_parent' => new \Zend_Db_Expr('0'),
588588
'store_id' => new \Zend_Db_Expr($store->getId()),
@@ -823,7 +823,7 @@ protected function getAllProducts(Store $store)
823823
'category_id' => new \Zend_Db_Expr($store->getRootCategoryId()),
824824
'product_id' => 'cp.entity_id',
825825
'position' => new \Zend_Db_Expr(
826-
$this->connection->getCheckSql('ccp.product_id IS NOT NULL', 'ccp.position', '0')
826+
$this->connection->getCheckSql('ccp.product_id IS NOT NULL', 'MIN(ccp.position)', '10000')
827827
),
828828
'is_parent' => new \Zend_Db_Expr(
829829
$this->connection->getCheckSql('ccp.product_id IS NOT NULL', '1', '0')

0 commit comments

Comments
 (0)