Preserve event status (isValid) set by other componets
michelezucchini opened this issue · comments
michelezucchini commented
In order to preserve how $event->isValid value setted by others componets/behaviours, it's better to change:
public function beforeSaveStatus($event)
{
$event->isValid = $this->sendToStatusInternal($this->getOwnerStatus(), true);
}
public function beforeDelete($event)
{
$event->isValid = $this->sendToStatusInternal(null, true);
}
to
$event->isValid&= $this->......
In my situation, i have a softdelete behaviour that set $event->isValid to FALSE to preserve the record, but SimpleWorkflowBehavior set it to TRUE!
And the record was really deleted..
Was it the best way to solve this problem?
raoul commented
hi @michelezucchini
good point ! I have merged your PR.
Thanks