Skip to content

Commit

Permalink
Make sure records are in DB before processing
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispenny committed Oct 2, 2023
1 parent 1e8e0fd commit ab601b1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Services/CacheProcessingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ abstract protected function shouldPublishUpdates(): bool;

public function processChange(DataObject $instance): void
{
// Can't process a record that hasn't been saved to the Database. This would only happen if a developer
// specifically calls processChange() in their code - as all module hooks for this method are triggered *after*
// write() type events
if (!$instance->isInDB()) {
return;
}

$className = $instance->getClassName();

// This record has already been processed in full. It is possible for multiple write() actions to be performed
Expand Down

0 comments on commit ab601b1

Please sign in to comment.