From 1b81ca0e85956bbdf5213fe0b1e08587d9802399 Mon Sep 17 00:00:00 2001 From: Vadym Honcharuk Date: Fri, 28 Apr 2023 14:10:22 +0300 Subject: [PATCH] Fix #2913, undefined array key date for elasticsuite tracker event index --- src/module-elasticsuite-tracker/Model/EventIndex.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/module-elasticsuite-tracker/Model/EventIndex.php b/src/module-elasticsuite-tracker/Model/EventIndex.php index 2ec2d01ea..71eb5a0f2 100644 --- a/src/module-elasticsuite-tracker/Model/EventIndex.php +++ b/src/module-elasticsuite-tracker/Model/EventIndex.php @@ -76,6 +76,11 @@ public function indexEvents($events) foreach ($events as $event) { if (isset($event['page']['store_id'])) { + // Previous "date" column has been renamed to "created_at" in db_schema.xml + if (!isset($event['date'])) { + $event['date'] = $event['created_at']; + } + $date = substr($event['date'], 0, 7); $index = $this->indexResolver->getIndex(self::INDEX_IDENTIFIER, $event['page']['store_id'], $date); if ($index !== null) {