Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only set actor on events that have it #3914

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: only set actor on events that have it
  • Loading branch information
SychO9 committed Oct 29, 2023
commit d304e17a7a298856c48e92885e357aa9e043620c
4 changes: 3 additions & 1 deletion framework/core/src/Foundation/DispatchEventsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public function dispatchEventsFor(mixed $entity, User $actor = null): void
}

foreach ($entity->releaseEvents() as $event) {
$event->actor = $actor;
if (property_exists($event, 'actor') && ! $event->actor) {
$event->actor = $actor;
}

$this->events->dispatch($event);
}
Expand Down
Loading