Skip to content

Commit

Permalink
NEW: Extend hooks for publish/unpublish
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Carlino committed Apr 20, 2021
1 parent 140e79b commit 00e710f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Actions/PublishItemWorkflowAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ public function execute(WorkflowInstance $workflow)
$target->write();
if ($target->hasMethod('publishRecursive')) {
$target->publishRecursive();
$this->extend('onAfterWorkflowPublish', $target);
}
}
} else {
if ($target->hasMethod('publishRecursive')) {
$target->publishRecursive();
$this->extend('onAfterWorkflowPublish', $target);
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/Jobs/WorkflowPublishTargetJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ public function process()
$target->PublishOnDate = '';
$target->writeWithoutVersion();
$target->publishRecursive();
$this->extend('onAfterWorkflowPublish', $target);
} elseif ($this->publishType == 'unpublish') {
$target->setIsPublishJobRunning(true);
$target->UnPublishOnDate = '';
$target->writeWithoutVersion();
$target->doUnpublish();
$this->extend('onAfterWorkflowUnublish', $target);
}
}
$this->currentStep = 1;
Expand Down

0 comments on commit 00e710f

Please sign in to comment.