Skip to content

Commit c5128e7

Browse files
committed
MAGETWO-40730: Merge attribute configuration with indexer for static attributes
1 parent 2f2c083 commit c5128e7

File tree

3 files changed

+16
-333
lines changed

3 files changed

+16
-333
lines changed

app/code/Magento/Customer/Model/Indexer/AttributeProvider.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ protected function convert(array $attributes, array $fieldset)
8989
'handler' => 'Magento\Framework\Indexer\Handler\AttributeHandler',
9090
'origin' => $attribute->getName(),
9191
'type' => $this->getType($attribute),
92-
'dataType' => $this->getBackendType($attribute),
92+
'dataType' => $attribute->getBackendType(),
9393
'filters' => [],
9494
'entity' => static::ENTITY,
9595
'bind' => isset($fieldset['references']['customer']['to'])
@@ -100,25 +100,13 @@ protected function convert(array $attributes, array $fieldset)
100100
} else {
101101
$fields[$attribute->getName()] = [
102102
'type' => $this->getType($attribute),
103-
'dataType' => $this->getBackendType($attribute),
104103
];
105104
}
106105
}
107106

108107
return $fields;
109108
}
110109

111-
/**
112-
* Get backend type for attribute
113-
*
114-
* @param Attribute $attribute
115-
* @return string
116-
*/
117-
protected function getBackendType(Attribute $attribute)
118-
{
119-
return $attribute->getBackendTypeByInput($attribute->getFrontendInput());
120-
}
121-
122110
/**
123111
* Get field type for attribute
124112
*
@@ -128,7 +116,7 @@ protected function getBackendType(Attribute $attribute)
128116
protected function getType(Attribute $attribute)
129117
{
130118
if (
131-
in_array($this->getBackendType($attribute), ['varchar', 'text'])
119+
in_array($attribute->getFrontendInput(), ['text', 'textarea'])
132120
&& $attribute->getData('is_searchable_in_grid')
133121
) {
134122
$type = 'searchable';

app/code/Magento/Customer/Test/Unit/Model/Indexer/Address/AttributeProviderTest.php

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

0 commit comments

Comments
 (0)