You are here

function workflow_update_7001 in Workflow 7

Initialize all workflows to show watchdog messages.

File

./workflow.install, line 379
Install, update and uninstall functions for the workflow module.

Code

function workflow_update_7001() {

  // Not all module functions are available from within a hook_update_N() function.
  // In order to call a function from your mymodule.module or an include file,
  // you need to explicitly load that file first.
  module_load_include('module', 'workflow');

  // Get all workflows.
  foreach (Workflow::getWorkflows() as $workflow) {

    // Add the option.
    $workflow->options['watchdog_log'] = 1;

    // Update the workflow without creating a creation state.
    $workflow
      ->save(FALSE);
  }
}