Skip to content

Commit 823f581

Browse files
committed
Merge branch 'MC-40672' of https://github.com/magento-l3/magento2ce into TANGO_PR-02-03-2021_24
2 parents c5339ce + fd26b34 commit 823f581

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

app/code/Magento/Elasticsearch/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@
506506
<item name="default" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\TextTransformer</item>
507507
<item name="date" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\DateTransformer</item>
508508
<item name="float" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\FloatTransformer</item>
509+
<item name="double" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\FloatTransformer</item>
509510
<item name="integer" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\IntegerTransformer</item>
510511
</argument>
511512
</arguments>

dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,25 @@
9090
/* Assign attribute to attribute set */
9191
$installer->addAttributeToGroup($productEntityTypeId, 'Default', 'General', $dateAttribute->getId());
9292

93+
$decimalAttribute = Bootstrap::getObjectManager()->create(Attribute::class);
94+
$decimalAttribute->setData(
95+
[
96+
'attribute_code' => 'decimal_attribute',
97+
'entity_type_id' => $productEntityTypeId,
98+
'is_global' => 1,
99+
'is_filterable' => 1,
100+
'is_user_defined' => 1,
101+
'backend_type' => 'decimal',
102+
'frontend_input' => 'weight',
103+
'frontend_label' => 'Test Decimal',
104+
'is_searchable' => 1,
105+
'is_filterable_in_search' => 1,
106+
]
107+
);
108+
$decimalAttribute->save();
109+
/* Assign attribute to attribute set */
110+
$installer->addAttributeToGroup($productEntityTypeId, 'Default', 'General', $decimalAttribute->getId());
111+
93112
$productAttributeSetId = $installer->getAttributeSetId($productEntityTypeId, 'Default');
94113
/* Create simple products per each first attribute option */
95114
foreach ($selectOptions[1] as $option) {
@@ -127,6 +146,7 @@
127146
$selectAttributes[1]->getAttributeCode() => $option->getId(),
128147
$selectAttributes[2]->getAttributeCode() => $selectOptions[2]->getLastItem()->getId(),
129148
$dateAttribute->getAttributeCode() => '10/30/2000',
149+
$decimalAttribute->getAttributeCode() => 1.11,
130150
],
131151
$product->getStoreId()
132152
);

dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes_rollback.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,10 @@
4242
$attribute->delete();
4343
}
4444

45+
$attribute->loadByCode($productEntityTypeId, 'decimal_attribute');
46+
if ($attribute->getId()) {
47+
$attribute->delete();
48+
}
49+
4550
$registry->unregister('isSecureArea');
4651
$registry->register('isSecureArea', false);

0 commit comments

Comments
 (0)