From eaab0f7ee309e777a243397e1fc01095541b0dc1 Mon Sep 17 00:00:00 2001 From: Pierre Gauthier Date: Fri, 6 Feb 2026 14:41:40 +0100 Subject: [PATCH] [Indexing] Fixes #3685 - Prevent fallback on default store value when attribute store value is set to null --- .../Indexer/Fulltext/Datasource/AbstractAttributeData.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/module-elasticsuite-catalog/Model/ResourceModel/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php b/src/module-elasticsuite-catalog/Model/ResourceModel/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php index d71897532..b7189a72a 100644 --- a/src/module-elasticsuite-catalog/Model/ResourceModel/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php +++ b/src/module-elasticsuite-catalog/Model/ResourceModel/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php @@ -140,12 +140,16 @@ public function getAttributesRawData($storeId, array $entityIds, $tableName, arr ['attribute_id', 'attribute_code'] ) ->where("entity.{$entityIdField} IN (?)", $entityIds) - ->where("t_attribute.attribute_id IN (?)", $attributeIds) - ->where("t_attribute.value IS NOT NULL"); + ->where("t_attribute.attribute_id IN (?)", $attributeIds); // Get the result and override values from a previous loop. foreach ($this->connection->fetchAll($select) as $row) { $key = "{$row['entity_id']}-{$row['attribute_id']}"; + if ($row['value'] === null) { + // When an attribute value is explicitly set to null in a higher-priority scope, do not use the fallback value. + unset($result[$key]); + continue; + } $result[$key] = $row; } }