Skip to content

Commit

Permalink
fix(SFT-1289): feedme updating translated fields across all languages (
Browse files Browse the repository at this point in the history
  • Loading branch information
seandelaney authored Aug 10, 2024
1 parent 6f9e5bb commit 5016a8a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/plugin/src/Elements/Db/EventQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ public function all($db = null): array

$this->cacheToStorage();
$this->orderEvents($this->events);
$this->indexEvents($this->events);

// Build up an event cache, to be accessed later
$this->cacheEvents();
Expand Down Expand Up @@ -1231,6 +1232,19 @@ private function cutOffExcess(array &$array): void
}
}

private function indexEvents(array &$array): void
{
if ($this->indexBy) {
$index = [];

foreach ($this->events as $event) {
$index[$event->{$this->indexBy}] = $event;
}

$array = $index;
}
}

/**
* Builds a cache of events for easy lookup with indexes.
*/
Expand Down

0 comments on commit 5016a8a

Please sign in to comment.