Skip to content

Commit

Permalink
fix(#136): fixed an error when saving events on multi-site pages
Browse files Browse the repository at this point in the history
  • Loading branch information
kjmartens committed May 27, 2022
1 parent 0b4718e commit fd6d4aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/plugin/src/Elements/Db/EventQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,16 @@ public function all($db = null): array
if (null === $this->events || self::$lastCachedConfigStateHash !== $configHash) {
$limit = $this->limit;
$offset = $this->offset;
$indexBy = $this->indexBy;
$this->limit = null;
$this->offset = null;
$this->indexBy = null;

$ids = parent::ids($db);

$this->limit = $limit;
$this->offset = $offset;
$this->indexBy = $indexBy;

if (empty($ids)) {
return [];
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/src/Services/EventsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function saveEvent(Event $event, bool $validateContent = true, bool $bypa
$transaction = \Craft::$app->db->beginTransaction();

try {
$isSaved = \Craft::$app->elements->saveElement($event, $validateContent);
$isSaved = \Craft::$app->elements->saveElement($event, $validateContent, $isNewEvent);
if ($isSaved) {
$this->reindexSearchForAllSites($event);

Expand Down

0 comments on commit fd6d4aa

Please sign in to comment.