Skip to content

Commit c812276

Browse files
martinyderimi-itk
authored andcommitted
Added type check
1 parent b7b2657 commit c812276

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

web/modules/custom/hoeringsportal_project/src/Helper/ProjectHelper.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,11 @@ public function entityPresave(EntityInterface $entity): void {
148148
catch (\Exception $e) {
149149
$this->logger->error('Error in node presave hook: @message', ['@message' => $e->getMessage()]);
150150
}
151-
}
152151

153-
// Delete orphaned paragraphs when references are removed.
154-
if ($entity->hasField('field_timeline')) {
152+
$this->entityTypeManagerInterface->getStorage('node')
153+
->resetCache([$entity->id()]);
154+
155+
// Delete orphaned paragraphs when references are removed.
155156
$this->deleteOrphanedParagraphs($entity);
156157
}
157158
}

0 commit comments

Comments
 (0)