Skip to content

Commit ee5935a

Browse files
committed
Merge remote-tracking branch 'origin/2.3.3-develop' into MC-18750
2 parents 98f99ae + af53acf commit ee5935a

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

app/code/Magento/Catalog/Model/ProductLink/Search.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
use Magento\Catalog\Api\Data\ProductInterface;
1212

13-
/** Returns collection of product visible in catalog by search key */
13+
/**
14+
* Returns collection of product visible in catalog by search key
15+
*/
1416
class Search
1517
{
1618
/**
@@ -58,7 +60,6 @@ public function prepareCollection(
5860
): \Magento\Catalog\Model\ResourceModel\Product\Collection {
5961
$productCollection = $this->productCollectionFactory->create();
6062
$productCollection->addAttributeToSelect(ProductInterface::NAME);
61-
$productCollection->setVisibility($this->catalogVisibility->getVisibleInCatalogIds());
6263
$productCollection->setPage($pageNum, $limit);
6364
$this->filter->addFilter($productCollection, 'fulltext', ['fulltext' => $searchKey]);
6465
$productCollection->setPage($pageNum, $limit);

app/code/Magento/Ui/view/base/web/js/grid/editing/record.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,6 @@ define([
134134

135135
field = utils.extend({}, fields.base, field);
136136

137-
field.__disableTmpl = {
138-
label: true,
139-
options: true
140-
};
141-
142137
return utils.template(field, {
143138
record: this,
144139
column: column

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/SearchTest.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public function testExecuteNonExistingSearchKey() : void
3838
->setPostValue('limit', 50);
3939
$this->dispatch('backend/catalog/product/search');
4040
$responseBody = $this->getResponse()->getBody();
41-
$this->assertContains('{"options":[],"total":0}', $responseBody);
41+
$jsonResponse = json_decode($responseBody, true);
42+
$this->assertEmpty($jsonResponse['options']);
4243
}
4344

4445
/**
@@ -57,6 +58,24 @@ public function testExecuteNotVisibleIndividuallyProducts() : void
5758
->setPostValue('limit', 50);
5859
$this->dispatch('backend/catalog/product/search');
5960
$responseBody = $this->getResponse()->getBody();
60-
$this->assertContains('{"options":[],"total":0}', $responseBody);
61+
$jsonResponse = json_decode($responseBody, true);
62+
$this->assertEquals(1, $jsonResponse['total']);
63+
$this->assertCount(1, $jsonResponse['options']);
64+
}
65+
66+
/**
67+
* @magentoDataFixture Magento/Catalog/_files/multiple_mixed_products.php
68+
*/
69+
public function testExecuteEnabledAndDisabledProducts() : void
70+
{
71+
$this->getRequest()
72+
->setPostValue('searchKey', 'simple')
73+
->setPostValue('page', 1)
74+
->setPostValue('limit', 50);
75+
$this->dispatch('backend/catalog/product/search');
76+
$responseBody = $this->getResponse()->getBody();
77+
$jsonResponse = json_decode($responseBody, true);
78+
$this->assertEquals(7, $jsonResponse['total']);
79+
$this->assertCount(7, $jsonResponse['options']);
6180
}
6281
}

lib/web/mage/utils/template.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ define([
4040
* To limit recursion for a specific property add __disableTmpl: {propertyName: numberOfCycles}.
4141
*
4242
* @param {String} tmpl
43-
* @param {Object} target
43+
* @param {Object | undefined} target
4444
* @returns {Boolean|Object}
4545
*/
4646
function isTmplIgnored(tmpl, target) {
@@ -136,7 +136,9 @@ define([
136136
cycles = 0;
137137

138138
while (~tmpl.indexOf(opener) && (typeof maxCycles === 'undefined' || cycles < maxCycles)) {
139-
tmpl = template(tmpl, data);
139+
if (!isTmplIgnored(tmpl)) {
140+
tmpl = template(tmpl, data);
141+
}
140142

141143
if (tmpl === last) {
142144
break;

0 commit comments

Comments
 (0)