You are here

function hook_workflow_history_alter in Workflow 8

Same name and namespace in other branches
  1. 7.2 workflow.api.php \hook_workflow_history_alter()
  2. 7 workflow.api.php \hook_workflow_history_alter()

Implements hook_workflow_history_alter().

In D8, hook_workflow_history_alter() is removed, in favour of ListBuilder::getDefaultOperations and hook_workflow_operations('workflow_transition').

Allow other modules to add Operations to the most recent history change. E.g., Workflow Revert implements an 'undo' operation.

Parameters

array $variables: The current workflow history information as an array. 'old_sid' - The state ID of the previous state. 'old_state_name' - The state name of the previous state. 'sid' - The state ID of the current state. 'state_name' - The state name of the current state. 'history' - The row from the workflow_transition_history table. 'transition' - a WorkflowTransition object, containing all of the above.

1 call to hook_workflow_history_alter()
workflow_devel_workflow_history_alter in modules/workflow_devel/workflow_devel.module
@inheritdoc
1 function implements hook_workflow_history_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

workflow_devel_workflow_history_alter in modules/workflow_devel/workflow_devel.module
@inheritdoc
1 invocation of hook_workflow_history_alter()
WorkflowTransitionListBuilder::buildRow in src/WorkflowTransitionListBuilder.php
Builds a row for an entity in the entity listing.

File

./workflow.api.php, line 171
Hooks provided by the workflow module.

Code

function hook_workflow_history_alter(array &$variables) {

  // workflow_debug(__FILE__, __FUNCTION__, __LINE__, '', '');
  // The Workflow module does nothing with this hook.
  // For an example implementation, see the Workflow Revert add-on.
}