function lightning_scheduler_entity_presave in Lightning Workflow 8.3
Same name and namespace in other branches
- 8 modules/lightning_scheduler/lightning_scheduler.module \lightning_scheduler_entity_presave()
- 8.2 modules/lightning_scheduler/lightning_scheduler.module \lightning_scheduler_entity_presave()
Implements hook_entity_presave().
File
- modules/
lightning_scheduler/ lightning_scheduler.module, line 144 - Contains hook implementations for Lightning Scheduler.
Code
function lightning_scheduler_entity_presave($entity) {
// This is a horrible hack to work around Content Moderation's opinions being
// a little too strong. See lightning_scheduler_update_8001().
if ($entity instanceof ContentEntityInterface && isset($entity->existingRevisionId)) {
$entity
->setNewRevision(FALSE);
$entity
->set($entity
->getEntityType()
->getKey('revision'), $entity->existingRevisionId);
unset($entity->existingRevisionId);
}
}