Skip to content

Commit c2a2f84

Browse files
author
Vadim Zubovich
committed
MAGNSWTCH-139: PR stabilization - Applied patch from Magento Architect
1 parent 0d55c65 commit c2a2f84

File tree

4 files changed

+5
-77
lines changed

4 files changed

+5
-77
lines changed

app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ class Source extends AbstractEav
2121
*/
2222
protected $_resourceHelper;
2323

24-
/**
25-
* @var \Magento\Eav\Model\Attribute\FrontendType
26-
*/
27-
protected $frontendType;
28-
2924
/**
3025
* Construct
3126
*
@@ -41,11 +36,9 @@ public function __construct(
4136
\Magento\Eav\Model\Config $eavConfig,
4237
\Magento\Framework\Event\ManagerInterface $eventManager,
4338
\Magento\Catalog\Model\Resource\Helper $resourceHelper,
44-
\Magento\Eav\Model\Attribute\FrontendType $frontendType,
4539
$resourcePrefix = null
4640
) {
4741
$this->_resourceHelper = $resourceHelper;
48-
$this->frontendType = $frontendType;
4942
parent::__construct($context, $eavConfig, $eventManager, $resourcePrefix);
5043
}
5144

@@ -79,11 +72,9 @@ protected function _getIndexableAttributes($multiSelect)
7972
);
8073

8174
if ($multiSelect == true) {
82-
$select->where('ea.backend_type = ?', 'varchar')
83-
->where('ea.frontend_input in (?)', $this->frontendType->getInputs('multiselect'));
75+
$select->where('ea.backend_type = ?', 'varchar')->where('ea.frontend_input = ?', 'multiselect');
8476
} else {
85-
$select->where('ea.backend_type = ?', 'int')
86-
->where('ea.frontend_input in (?)', $this->frontendType->getInputs('select'));
77+
$select->where('ea.backend_type = ?', 'int')->where('ea.frontend_input = ?', 'select');
8778
}
8879

8980
return $this->_getReadAdapter()->fetchCol($select);

app/code/Magento/CatalogSearch/Model/Resource/Engine.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ class Engine extends AbstractDb implements EngineInterface
3030
*/
3131
protected $productFactoryNames;
3232

33-
/**
34-
* @var \Magento\Eav\Model\Attribute\FrontendType
35-
*/
36-
protected $frontendType;
37-
3833
/**
3934
* Catalog search data
4035
*
@@ -44,7 +39,7 @@ class Engine extends AbstractDb implements EngineInterface
4439

4540
/**
4641
* Construct
47-
*
42+
*
4843
* @param \Magento\Framework\Model\Resource\Db\Context $context
4944
* @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility
5045
* @param Advanced $searchResource
@@ -57,13 +52,11 @@ public function __construct(
5752
\Magento\Catalog\Model\Product\Visibility $catalogProductVisibility,
5853
\Magento\CatalogSearch\Model\Resource\Advanced $searchResource,
5954
\Magento\CatalogSearch\Helper\Data $catalogSearchData,
60-
\Magento\Eav\Model\Attribute\FrontendType $frontendType,
6155
$resourcePrefix = null
6256
) {
6357
$this->_catalogProductVisibility = $catalogProductVisibility;
6458
$this->_searchResource = $searchResource;
6559
$this->_catalogSearchData = $catalogSearchData;
66-
$this->frontendType = $frontendType;
6760
parent::__construct($context, $resourcePrefix);
6861
}
6962

@@ -156,15 +149,10 @@ public function allowAdvancedIndex()
156149
*/
157150
private function isTermFilterableAttribute($attribute)
158151
{
159-
$inputTypes = array_merge(
160-
$this->frontendType->getInputs('select'),
161-
$this->frontendType->getInputs('multiselect')
162-
);
163-
164152
return ($attribute->getIsVisibleInAdvancedSearch()
165153
|| $attribute->getIsFilterable()
166154
|| $attribute->getIsFilterableInSearch())
167-
&& in_array($attribute->getFrontendInput(), $inputTypes);
155+
&& in_array($attribute->getFrontendInput(), ['select', 'multiselect']);
168156
}
169157

170158
/**

app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Options.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public function getStoreOptionValues($storeId)
268268
*
269269
* @return \Magento\Eav\Model\Entity\Attribute\AbstractAttribute
270270
*/
271-
private function getAttributeObject()
271+
protected function getAttributeObject()
272272
{
273273
return $this->_registry->registry('entity_attribute');
274274
}

app/code/Magento/Eav/Model/Attribute/FrontendType.php

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)