mirror of
https://github.com/jbcr/SyliusElasticsearchPlugin.git
synced 2026-03-24 00:42:08 +01:00
Fix error for select attribute without value
This commit is contained in:
@@ -59,7 +59,7 @@ final class AttributeBuilder extends AbstractBuilder
|
||||
$index = $this->attributeNameResolver->resolvePropertyName($attributeCode);
|
||||
$value = $attributeValue->getValue();
|
||||
if ($attribute->getType() === 'select') {
|
||||
$choices = $attribute->getConfiguration()['choices'];
|
||||
$choices = $attribute->getConfiguration()['choices'] ?? [];
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $i => $item) {
|
||||
$value[$i] = $choices[$item][$this->localeContext->getLocaleCode()] ?? $item;
|
||||
|
||||
Reference in New Issue
Block a user