Skip to content

Commit

Permalink
Fix an issue where draft Matrix blocks (entries) were being used for …
Browse files Browse the repository at this point in the history
…submissions
  • Loading branch information
engram-design committed Aug 27, 2024
1 parent b643ec0 commit cde302e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/services/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public function onBeforeSaveEntry(ModelEvent $event): void
return;
}

// Don't trigger for Matrix/etc which are entries
if ($event->sender->fieldId) {
return;
}

$currentSite = Craft::$app->getSites()->getCurrentSite();

// Sanitize notes first
Expand Down Expand Up @@ -146,6 +151,11 @@ public function onAfterSaveElement(ElementEvent $event): void
return;
}

// Don't trigger for Matrix/etc which are entries
if ($event->element->fieldId) {
return;
}

$request = Craft::$app->getRequest();
$action = $request->getBodyParam('workflow-action');

Expand Down

0 comments on commit cde302e

Please sign in to comment.