Skip to content

Commit

Permalink
Merge pull request #442 from unclecheese/pulls/5.3/publish-extension-…
Browse files Browse the repository at this point in the history
…hooks

NEW: Extend hooks for publish/unpublish
  • Loading branch information
Aaron Carlino authored Apr 22, 2021
2 parents 140e79b + 00e710f commit ef3c840
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 ef3c840

Please sign in to comment.