Skip to content

Commit

Permalink
Fix Smile-SA#2913, undefined array key date for elasticsuite tracker …
Browse files Browse the repository at this point in the history
…event index
  • Loading branch information
vahonc authored and rbayet committed Nov 13, 2023
1 parent 57f8a64 commit 19426a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/module-elasticsuite-tracker/Model/EventIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 19426a1

Please sign in to comment.