Skip to content

Commit 4f7a3ea

Browse files
Merge branch 'develop' of https://github.com/magento/magento2ce into MAGETWO-69411
2 parents 9d1011c + 83e7b3b commit 4f7a3ea

File tree

21 files changed

+995
-204
lines changed

21 files changed

+995
-204
lines changed

app/code/Magento/Bundle/Model/ResourceModel/Selection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function getParentIdsByChild($childId)
126126
'e.' . $metadata->getLinkField() . ' = ' . $this->getMainTable() . '.parent_product_id',
127127
['e.entity_id as parent_product_id']
128128
)->where(
129-
'e.entity_id IN(?)',
129+
$this->getMainTable() . '.product_id IN(?)',
130130
$childId
131131
);
132132

app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_form.xml

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -431,65 +431,6 @@
431431
</formElements>
432432
</field>
433433
</container>
434-
<container name="container_deferred_stock_update" component="Magento_Ui/js/form/components/group" sortOrder="850">
435-
<argument name="data" xsi:type="array">
436-
<item name="config" xsi:type="array">
437-
<item name="formElement" xsi:type="string">container</item>
438-
<item name="label" xsi:type="string" translate="true">Use Deferred Stock Update</item>
439-
<item name="dataScope" xsi:type="string">stock_data</item>
440-
<item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
441-
</item>
442-
</argument>
443-
<field name="deferred_stock_update" formElement="select">
444-
<argument name="data" xsi:type="array">
445-
<item name="config" xsi:type="array">
446-
<item name="rawOptions" xsi:type="boolean">true</item>
447-
<item name="value" xsi:type="object">Magento\CatalogInventory\Model\Source\StockConfiguration</item>
448-
</item>
449-
</argument>
450-
<settings>
451-
<scopeLabel>[GLOBAL]</scopeLabel>
452-
<label translate="true">Use Deferred Stock Update</label>
453-
<dataScope>deferred_stock_update</dataScope>
454-
</settings>
455-
<formElements>
456-
<select>
457-
<settings>
458-
<options class="Magento\Config\Model\Config\Source\Yesno"/>
459-
</settings>
460-
</select>
461-
</formElements>
462-
</field>
463-
<field name="use_config_deferred_stock_update" component="Magento_CatalogInventory/js/components/use-config-settings" formElement="checkbox">
464-
<argument name="data" xsi:type="array">
465-
<item name="config" xsi:type="array">
466-
<item name="value" xsi:type="string">1</item>
467-
<item name="valueFromConfig" xsi:type="object">Magento\CatalogInventory\Model\Source\StockConfiguration</item>
468-
<item name="keyInConfiguration" xsi:type="string">deferred_stock_update</item>
469-
</item>
470-
</argument>
471-
<settings>
472-
<dataScope>use_config_deferred_stock_update</dataScope>
473-
<links>
474-
<link name="linkedValue">${$.provider}:data.product.stock_data.deferred_stock_update</link>
475-
</links>
476-
<exports>
477-
<link name="checked">${$.parentName}.deferred_stock_update:disabled</link>
478-
</exports>
479-
</settings>
480-
<formElements>
481-
<checkbox class="Magento\CatalogInventory\Ui\Component\Product\Form\Element\UseConfigSettings">
482-
<settings>
483-
<description translate="true">Use Config Settings</description>
484-
<valueMap>
485-
<map name="false" xsi:type="string">0</map>
486-
<map name="true" xsi:type="string">1</map>
487-
</valueMap>
488-
</settings>
489-
</checkbox>
490-
</formElements>
491-
</field>
492-
</container>
493434
<container name="container_notify_stock_qty" component="Magento_Ui/js/form/components/group" sortOrder="900">
494435
<argument name="data" xsi:type="array">
495436
<item name="config" xsi:type="array">

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

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ class DataProvider
9494
*/
9595
private $metadata;
9696

97+
/**
98+
* @var array
99+
*/
100+
private $attributeOptions = [];
101+
97102
/**
98103
* @param ResourceConnection $resource
99104
* @param \Magento\Catalog\Model\Product\Type $catalogProductType
@@ -177,23 +182,13 @@ public function getSearchableProducts(
177182
return $result;
178183
}
179184

180-
/**
181-
* Retrieve EAV Config Singleton
182-
*
183-
* @return \Magento\Eav\Model\Config
184-
*/
185-
private function getEavConfig()
186-
{
187-
return $this->eavConfig;
188-
}
189-
190185
/**
191186
* Retrieve searchable attributes
192187
*
193188
* @param string $backendType
194189
* @return \Magento\Eav\Model\Entity\Attribute[]
195190
*/
196-
private function getSearchableAttributes($backendType = null)
191+
public function getSearchableAttributes($backendType = null)
197192
{
198193
if (null === $this->searchableAttributes) {
199194
$this->searchableAttributes = [];
@@ -210,7 +205,7 @@ private function getSearchableAttributes($backendType = null)
210205
['engine' => $this->engine, 'attributes' => $attributes]
211206
);
212207

213-
$entity = $this->getEavConfig()->getEntityType(\Magento\Catalog\Model\Product::ENTITY)->getEntity();
208+
$entity = $this->eavConfig->getEntityType(\Magento\Catalog\Model\Product::ENTITY)->getEntity();
214209

215210
foreach ($attributes as $attribute) {
216211
$attribute->setEntity($entity);
@@ -239,7 +234,7 @@ private function getSearchableAttributes($backendType = null)
239234
* @param int|string $attribute
240235
* @return \Magento\Eav\Model\Entity\Attribute
241236
*/
242-
private function getSearchableAttribute($attribute)
237+
public function getSearchableAttribute($attribute)
243238
{
244239
$attributes = $this->getSearchableAttributes();
245240
if (is_numeric($attribute)) {
@@ -254,7 +249,7 @@ private function getSearchableAttribute($attribute)
254249
}
255250
}
256251

257-
return $this->getEavConfig()->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $attribute);
252+
return $this->eavConfig->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $attribute);
258253
}
259254

260255
/**
@@ -487,11 +482,21 @@ private function getAttributeValue($attributeId, $valueId, $storeId)
487482
&& $attribute->usesSource()
488483
&& $this->engine->allowAdvancedIndex()
489484
) {
490-
$attribute->setStoreId($storeId);
485+
if (!isset($this->attributeOptions[$attributeId][$storeId])) {
486+
$attribute->setStoreId($storeId);
487+
$options = $attribute->getSource()->toOptionArray();
488+
$this->attributeOptions[$attributeId][$storeId] = array_combine(
489+
array_column($options, 'value'),
490+
array_column($options, 'label')
491+
);
492+
}
491493

492-
$valueText = (array) $attribute->getSource()->getIndexOptionText($valueId);
494+
$valueText = '';
495+
if (isset($this->attributeOptions[$attributeId][$storeId][$valueId])) {
496+
$valueText = $this->attributeOptions[$attributeId][$storeId][$valueId];
497+
}
493498

494-
$pieces = array_filter(array_merge([$value], $valueText));
499+
$pieces = array_filter(array_merge([$value], [$valueText]));
495500

496501
$value = implode($this->separator, $pieces);
497502
}

0 commit comments

Comments
 (0)