You are here

function workflow_revert in Workflow 7.2

Revert a single workflow.

2 calls to workflow_revert()
EntityWorkflowUIController::applyOperation in workflow_admin_ui/includes/Entity/EntityWorkflowUIController.php
Overrides the 'revert' action, to not delete the workflows.
WorkflowFeaturesController::revert in ./workflow.features.inc
Revert this workflow, either creating the workflow new (if one with the same machine name is not present), or updating the existing workflow.
1 string reference to 'workflow_revert'
workflow_revert_form in workflow_revert/workflow_revert.pages.inc
Menu callback to do the revert function.

File

./workflow.module, line 1188
Support workflows made up of arbitrary states.

Code

function workflow_revert($defaults, $name) {
  $workflow = $defaults[$name];
  $old = workflow_load_by_name($name);
  if ($old) {
    $workflow->wid = $old->wid;
    $workflow->is_new = FALSE;
    $workflow->is_reverted = TRUE;
  }
  $workflow
    ->save();
}