Skip to content

Commit 0a478f6

Browse files
author
Joan He
committed
Merge remote-tracking branch 'upstream/2.3-develop' into MAGETWO-68802-Clicking-Empty-Toggle
2 parents a3b0bd7 + a998870 commit 0a478f6

File tree

71 files changed

+949
-156
lines changed

Some content is hidden

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

71 files changed

+949
-156
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,7 @@ Tests:
19771977
* [#686](https://github.com/magento/magento2/issues/686) -- Product save validation errors in the admin don't hide the overlay
19781978
* [#702](https://github.com/magento/magento2/issues/702) -- Base table or view not found
19791979
* [#652](https://github.com/magento/magento2/issues/652) -- Multishipping checkout not to change the Billing address js issue
1980-
* [#648](https://github.com/magento/magento2/issues/648) -- An equal (=) sign in the hash of the product page to to break the tabs functionality
1980+
* [#648](https://github.com/magento/magento2/issues/648) -- An equal (=) sign in the hash of the product page to break the tabs functionality
19811981
* Service Contracts:
19821982
* Refactored usage of new API of the Customer module
19831983
* Implemented Service Contracts for the Sales module

app/code/Magento/Backend/view/adminhtml/templates/page/header.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<?= /* @escapeNotVerified */ $edition ?>
1818
class="logo">
1919
<img class="logo-img" src="<?= /* @escapeNotVerified */ $block->getViewFileUrl($logoSrc) ?>"
20-
alt="<?= $block->escapeHtml(__('Magento Admin Panel')) ?>"/>
20+
alt="<?= $block->escapeHtml(__('Magento Admin Panel')) ?>" title="<?= $block->escapeHtml(__('Magento Admin Panel')) ?>"/>
2121
</a>
2222
<?php break; ?>
2323
<?php case 'user': ?>

app/code/Magento/Backend/view/adminhtml/templates/widget/form/element/gallery.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<?php foreach ($block->getValues()->getAttributeBackend()->getImageTypes() as $type): ?>
3535
<td class="gallery" align="center" style="vertical-align:bottom;">
3636
<a href="<?= /* @escapeNotVerified */ $image->setType($type)->getSourceUrl() ?>" target="_blank" onclick="imagePreview('<?= $block->getElement()->getHtmlId() ?>_image_<?= /* @escapeNotVerified */ $type ?>_<?= /* @escapeNotVerified */ $image->getValueId() ?>');return false;">
37-
<img id="<?= $block->getElement()->getHtmlId() ?>_image_<?= /* @escapeNotVerified */ $type ?>_<?= /* @escapeNotVerified */ $image->getValueId() ?>" src="<?= /* @escapeNotVerified */ $image->setType($type)->getSourceUrl() ?>?<?= /* @escapeNotVerified */ time() ?>" alt="<?= /* @escapeNotVerified */ $image->getValue() ?>" height="25" class="small-image-preview v-middle"/></a><br/>
37+
<img id="<?= $block->getElement()->getHtmlId() ?>_image_<?= /* @escapeNotVerified */ $type ?>_<?= /* @escapeNotVerified */ $image->getValueId() ?>" src="<?= /* @escapeNotVerified */ $image->setType($type)->getSourceUrl() ?>?<?= /* @escapeNotVerified */ time() ?>" alt="<?= /* @escapeNotVerified */ $image->getValue() ?>" title="<?= /* @escapeNotVerified */ $image->getValue() ?>" height="25" class="small-image-preview v-middle"/></a><br/>
3838
<input type="file" name="<?= /* @escapeNotVerified */ $block->getElement()->getName() ?>_<?= /* @escapeNotVerified */ $type ?>[<?= /* @escapeNotVerified */ $image->getValueId() ?>]" size="1"></td>
3939
<?php endforeach; ?>
4040
<td class="gallery" align="center" style="vertical-align:bottom;"><input type="input" name="<?= /* @escapeNotVerified */ $block->getElement()->getParentName() ?>[position][<?= /* @escapeNotVerified */ $image->getValueId() ?>]" value="<?= /* @escapeNotVerified */ $image->getPosition() ?>" id="<?= $block->getElement()->getHtmlId() ?>_position_<?= /* @escapeNotVerified */ $image->getValueId() ?>" size="3"/></td>

app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher;
99
use Magento\Framework\DB\Query\Generator as QueryGenerator;
1010
use Magento\Framework\App\ResourceConnection;
11+
use Magento\Indexer\Model\ProcessManager;
1112

1213
/**
1314
* Class Full reindex action
@@ -44,6 +45,11 @@ class Full extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractActio
4445
*/
4546
private $activeTableSwitcher;
4647

48+
/**
49+
* @var ProcessManager
50+
*/
51+
private $processManager;
52+
4753
/**
4854
* @param ResourceConnection $resource
4955
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
@@ -52,9 +58,10 @@ class Full extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractActio
5258
* @param \Magento\Framework\Indexer\BatchSizeManagementInterface|null $batchSizeManagement
5359
* @param \Magento\Framework\Indexer\BatchProviderInterface|null $batchProvider
5460
* @param \Magento\Framework\EntityManager\MetadataPool|null $metadataPool
55-
* @param \Magento\Indexer\Model\Indexer\StateFactory|null $stateFactory
5661
* @param int|null $batchRowsCount
5762
* @param ActiveTableSwitcher|null $activeTableSwitcher
63+
* @param ProcessManager $processManager
64+
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
5865
*/
5966
public function __construct(
6067
\Magento\Framework\App\ResourceConnection $resource,
@@ -65,7 +72,8 @@ public function __construct(
6572
\Magento\Framework\Indexer\BatchProviderInterface $batchProvider = null,
6673
\Magento\Framework\EntityManager\MetadataPool $metadataPool = null,
6774
$batchRowsCount = null,
68-
ActiveTableSwitcher $activeTableSwitcher = null
75+
ActiveTableSwitcher $activeTableSwitcher = null,
76+
ProcessManager $processManager = null
6977
) {
7078
parent::__construct(
7179
$resource,
@@ -85,6 +93,7 @@ public function __construct(
8593
);
8694
$this->batchRowsCount = $batchRowsCount;
8795
$this->activeTableSwitcher = $activeTableSwitcher ?: $objectManager->get(ActiveTableSwitcher::class);
96+
$this->processManager = $processManager ?: $objectManager->get(ProcessManager::class);
8897
}
8998

9099
/**
@@ -133,6 +142,38 @@ public function execute()
133142
return $this;
134143
}
135144

145+
/**
146+
* Run reindexation
147+
*
148+
* @return void
149+
*/
150+
protected function reindex()
151+
{
152+
$userFunctions = [];
153+
154+
foreach ($this->storeManager->getStores() as $store) {
155+
if ($this->getPathFromCategoryId($store->getRootCategoryId())) {
156+
$userFunctions[$store->getId()] = function () use ($store) {
157+
return $this->reindexStore($store);
158+
};
159+
}
160+
}
161+
162+
$this->processManager->execute($userFunctions);
163+
}
164+
165+
/**
166+
* Execute indexation by store
167+
*
168+
* @param \Magento\Store\Model\Store $store
169+
*/
170+
private function reindexStore($store)
171+
{
172+
$this->reindexRootCategory($store);
173+
$this->reindexAnchorCategories($store);
174+
$this->reindexNonAnchorCategories($store);
175+
}
176+
136177
/**
137178
* Publish data from tmp to replica table
138179
*

app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,9 @@
4545
<!-- @TODO: MAGETWO-80272 Move to Magento_Checkout -->
4646
<seeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart" />
4747
</actionGroup>
48-
</actionGroups>
48+
49+
<actionGroup name="StorefrontSwitchCategoryViewToListMode">
50+
<click selector="{{StorefrontCategoryMainSection.modeListButton}}" stepKey="switchCategoryViewToListMode"/>
51+
<waitForElement selector="{{StorefrontCategoryMainSection.CategoryTitle}}" time="30" stepKey="waitForCategoryReload"/>
52+
</actionGroup>
53+
</actionGroups>

app/code/Magento/Catalog/view/frontend/templates/product/view/addto/compare.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
// @codingStandardsIgnoreFile
88

9-
/** @var $block \Magento\Catalog\Block\Catalog\Product\View\Addto\Compare */
9+
/** @var $block \Magento\Catalog\Block\Product\View\Addto\Compare */
1010
?>
1111

1212
<a href="#" data-post='<?= /* @escapeNotVerified */ $block->getPostDataParams() ?>'

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function getTree(ResolveInfo $resolveInfo, int $rootCategoryId) : array
100100
$collection->addFieldToFilter('level', ['lteq' => $level + $depth - self::DEPTH_OFFSET]);
101101
$collection->setOrder('level');
102102
$collection->getSelect()->orWhere(
103-
$this->metadata->getMetadata(CategoryInterface::class)->getLinkField() . ' = ?',
103+
$this->metadata->getMetadata(CategoryInterface::class)->getIdentifierField() . ' = ?',
104104
$rootCategoryId
105105
);
106106
return $this->processTree($collection->getIterator());

app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
use Magento\CatalogSearch\Model\ResourceModel\Fulltext as FulltextResource;
1111
use Magento\Framework\Indexer\Dimension\DimensionProviderInterface;
1212
use Magento\Store\Model\StoreDimensionProvider;
13+
use Magento\Indexer\Model\ProcessManager;
1314

1415
/**
1516
* Provide functionality for Fulltext Search indexing.
1617
*
18+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
19+
*
1720
* @api
1821
* @since 100.0.2
1922
*/
@@ -62,14 +65,20 @@ class Fulltext implements
6265
*/
6366
private $dimensionProvider;
6467

68+
/**
69+
* @var ProcessManager
70+
*/
71+
private $processManager;
72+
6573
/**
6674
* @param FullFactory $fullActionFactory
6775
* @param IndexerHandlerFactory $indexerHandlerFactory
6876
* @param FulltextResource $fulltextResource
69-
* @param array $data
7077
* @param IndexSwitcherInterface $indexSwitcher
7178
* @param StateFactory $indexScopeStateFactory
7279
* @param DimensionProviderInterface $dimensionProvider
80+
* @param array $data
81+
* @param ProcessManager $processManager
7382
*/
7483
public function __construct(
7584
FullFactory $fullActionFactory,
@@ -78,7 +87,8 @@ public function __construct(
7887
IndexSwitcherInterface $indexSwitcher,
7988
StateFactory $indexScopeStateFactory,
8089
DimensionProviderInterface $dimensionProvider,
81-
array $data
90+
array $data,
91+
ProcessManager $processManager = null
8292
) {
8393
$this->fullAction = $fullActionFactory->create(['data' => $data]);
8494
$this->indexerHandlerFactory = $indexerHandlerFactory;
@@ -87,6 +97,9 @@ public function __construct(
8797
$this->indexSwitcher = $indexSwitcher;
8898
$this->indexScopeState = $indexScopeStateFactory->create();
8999
$this->dimensionProvider = $dimensionProvider;
100+
$this->processManager = $processManager ?: \Magento\Framework\App\ObjectManager::getInstance()->get(
101+
ProcessManager::class
102+
);
90103
}
91104

92105
/**
@@ -145,9 +158,13 @@ public function executeByDimension(array $dimensions, \Traversable $entityIds =
145158
*/
146159
public function executeFull()
147160
{
161+
$userFunctions = [];
148162
foreach ($this->dimensionProvider->getIterator() as $dimension) {
149-
$this->executeByDimension($dimension);
163+
$userFunctions[] = function () use ($dimension) {
164+
$this->executeByDimension($dimension);
165+
};
150166
}
167+
$this->processManager->execute($userFunctions);
151168
}
152169

153170
/**

app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/FulltextTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ class FulltextTest extends \PHPUnit\Framework\TestCase
4444
*/
4545
private $dimensionProviderMock;
4646

47+
/**
48+
* @var \Magento\Indexer\Model\ProcessManager|\PHPUnit_Framework_MockObject_MockObject
49+
*/
50+
private $processManager;
51+
4752
protected function setUp()
4853
{
4954
$this->fullAction = $this->getClassMock(\Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::class);
@@ -70,6 +75,11 @@ protected function setUp()
7075
$stateMock = $this->getMockBuilder(\Magento\CatalogSearch\Model\Indexer\Scope\State::class)
7176
->getMock();
7277
$objectManagerHelper = new ObjectManagerHelper($this);
78+
79+
$this->processManager = new \Magento\Indexer\Model\ProcessManager(
80+
$this->getClassMock(\Magento\Framework\App\ResourceConnection::class)
81+
);
82+
7383
$this->model = $objectManagerHelper->getObject(
7484
\Magento\CatalogSearch\Model\Indexer\Fulltext::class,
7585
[
@@ -80,6 +90,7 @@ protected function setUp()
8090
'indexSwitcher' => $this->indexSwitcher,
8191
'dimensionProvider' => $this->dimensionProviderMock,
8292
'indexScopeState' => $stateMock,
93+
'processManager' => $this->processManager,
8394
]
8495
);
8596
}

app/code/Magento/CatalogSearch/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"magento/framework": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-catalog": "*",
12+
"magento/module-indexer": "100.2.*",
1213
"magento/module-catalog-inventory": "*",
1314
"magento/module-customer": "*",
1415
"magento/module-directory": "*",

0 commit comments

Comments
 (0)