Skip to content

Commit 8114af3

Browse files
author
Stanislav Idolov
authored
ENGCOM-3075: Empty option label should always be a space even if attribute is required #18221
2 parents 547e2a3 + 3d5e275 commit 8114af3

File tree

1 file changed

+5
-1
lines changed
  • app/code/Magento/Eav/Model/Entity/Attribute/Source

1 file changed

+5
-1
lines changed

app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
use Magento\Store\Model\StoreManagerInterface;
1010

1111
/**
12+
* Eav attribute default source when values are coming from another table
13+
*
1214
* @api
1315
* @since 100.0.2
1416
*/
@@ -127,12 +129,14 @@ public function getSpecificOptions($ids, $withEmpty = true)
127129
}
128130

129131
/**
132+
* Add an empty option to the array
133+
*
130134
* @param array $options
131135
* @return array
132136
*/
133137
private function addEmptyOption(array $options)
134138
{
135-
array_unshift($options, ['label' => $this->getAttribute()->getIsRequired() ? '' : ' ', 'value' => '']);
139+
array_unshift($options, ['label' => ' ', 'value' => '']);
136140
return $options;
137141
}
138142

0 commit comments

Comments
 (0)