Hi, I'm currently getting the message:

You are currently viewing the possible transitions to and from workflow states. The state is shown in the left column; the state to be moved to is to the right. For each transition, check the box next to the role(s) that may initiate the transition. For example, if only the "production editor" role may move a node from Review state to the Published state, check the box next to "production editor". The author role is built in and refers to the user who authored the node.

on 403 and 404 pages.

Removing strstr($path, and ): in function workflow_help seems to clear things up, but I don't know what other effects it would have.

??

Comments

Nick Fedchik’s picture

Confirm. On my site it's same message for anon user instead of title page.

Page not found
You are currently viewing the possible transitions to and from workflow states. The state is shown in the left column; the state to be moved to is to the right. For each transition, check the box next to the role(s) that may initiate the transition. For example, if only the "production editor" role may move a node from Review state to the Published state, check the box next to "production editor". The author role is built in and refers to the user who authored the node.
The requested page could not be found.
avpaderno’s picture

I changed the code to:

/**
 * Implementation of hook_help().
 */
function workflow_help($path, $arg) {
  if (strstr($path, 'admin/build/workflow/edit')) {
    return t('You are currently viewing the possible transitions to and from workflow states. The state is shown in the left column; the state to be moved to is to the right. For each transition, check the box next to the role(s) that may initiate the transition. For example, if only the "production editor" role may move a node from Review state to the Published state, check the box next to "production editor". The author role is built in and refers to the user who authored the node.');
  }
  elseif ($path == 'admin/build/workflow/add') {
    return t('To get started, provide a name for your workflow. This name will be used as a label when the workflow status is shown during node editing.');
  }
  elseif (strstr($path, 'admin/build/workflow/state')) {
    return t('Enter the name for a state in your workflow. For example, if you were doing a meal workflow it may include states like <em>shop</em>, <em>prepare</em>, <em>eat</em>, and <em>clean up</em>.');
  }
  elseif (strstr($path, 'admin/build/workflow/actions')) {
    return t('Use this page to set actions to happen when transitions occur. To <a href="@link">configure actions</a>, use the actions module.', array('@link' => url('admin/actions')));
  }
}

To simply remove the call to strstr() makes the help appear in less places where it should appear. The module checks if the path starts with the second string passed to the function, and when it finds the first characters of the path it shows the appropriate text.

There could be a better way to do that, like checking for a path like 'admin/build/workflow/edit/%' (which is permitted from Drupal 6). I should check if that would match also 'admin/build/workflow/edit/1/2', or just 'admin/build/workflow/edit/1'. If this would be the case, the code would become:

  switch ($path) {
    case 'admin/build/workflow/edit':
    case 'admin/build/workflow/edit/%':
      // ...
  }

I will check about that tomorrow.

avpaderno’s picture

I changed the code like follow:

/**
 * Implementation of hook_help().
 */
function workflow_help($path, $arg) {
  switch ($path) {
    case 'admin/build/workflow/edit/%':
      $help = t('You are currently viewing the possible transitions to and from workflow states. The state is shown in the left column; the state to be moved to is to the right. For each transition, check the box next to the role(s) that may initiate the transition. For example, if only the "production editor" role may move a node from Review state to the Published state, check the box next to "production editor". The author role is built in and refers to the user who authored the node.');
      break;
    
    case 'admin/build/workflow/add':
      $help = t('To get started, provide a name for your workflow. This name will be used as a label when the workflow status is shown during node editing.');
      break;
    
    case 'admin/build/workflow/state':
      $help = t('Enter the name for a state in your workflow. For example, if you were doing a meal workflow it may include states like <em>shop</em>, <em>prepare</em>, <em>eat</em>, and <em>clean up</em>.');
      break;
    
    case 'admin/build/workflow/actions':
      $help = t('Use this page to set actions to happen when transitions occur. To <a href="@link">configure actions</a>, use the actions module.', array('@link' => url('admin/actions')));
      break;
    
    default:
      $help = '';
      break;
  }
  
  return $help;
}

I removed the help text from pages where it should not have any sense (and which has been catched from the original code) by restricting the match; it doesn't make any sense to present a the same help to the page to add a state, and to the page to delete it.

jvandyk’s picture

Status: Active » Fixed

Fixed. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.