Project:Workflow
Version:5.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

I am getting the help menu on nodes that are uncategorized.
This shows up with logged in or anonymous.

'You are currently viewing the possible transitions to and from workflow states. ....' shows up at the top of a node even if there is content in the node. There are also no tabs for the workflow states when not logged in or when the user

Only seems to be happening on the nodes that are uncategorized.

Comments

#1

I dont fully understand why the menu shows up on the uncategorized node pages, but I have figured out how to fix it from showing FOR MY INSTALL.

I had to change the workflow_help function to:

/**
* Implementation of hook_help().
*/
function workflow_help($section) {
  $workflow_menu_section = explode('/', $section);
  $workflow_vars = $workflow_menu_section[2].'/'.$workflow_menu_section[3];
 
  switch ($workflow_vars) {
//    case strstr($section, 'admin/build/workflow/edit'):
    case '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 hulking_editor role may move a node from Review state to the Published state, check the box next to hulking_editor. The author role is built in and refers to the user who authored the node.');
      break;
//    case 'admin/build/workflow/add':
    case '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.');
      break;
//    case strstr($section, 'admin/build/workflow/state'):
    case '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 food</em>, <em>eat</em>, and <em>clean up</em>.');
      break;
//    case strstr($section, 'admin/build/workflow/actions') && (sizeof($section) == 22):
    case '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')));
      break;
  }
}

First, per php, there should be a 'break;' after each case check otherwise it continues to process the rest of the cases.

Then: case strstr($section, 'admin/build/workflow/edit'):
would actually return: admin/build/workflow/edit...............and anything after the needle (the second para in the strstr function)

so, yes, it is matching the whole $section string like it should BUT i dont know enough about the drupal hook system to know why this is happening.

Anyway,
so i made the hook more dependant on specific vals by exploding and using the two specific vals for the array of the url.

This WONT work if you move the install to a new dir. like domain.com/drupal/

SO THIS IS A HACK that works for me.

#2

I ran into the same issue. Here's a smaller patch that also works: add the indicated two lines after the switch. The strstr case always matches when compared against an empty section, so the new case prevents it from being reached.

<?php
/**
* Implementation of hook_help().
*/
function workflow_help($section) {
  switch (
$section) {
    case
'':      // ashearer 2007-08-12
     
return ''// ashearer 2007-08-12
   
case strstr($section, 'admin/build/workflow/edit'):
      return ...
?>

#3

Title:workflow_help showing on pages» workflow_help showing on pages
Status:active» needs review

Patch version of the above. Tested with Drupal 5.2 and PHP 5.2.2 on Linux.

AttachmentSize
workflow_6.patch 847 bytes

#4

Status:needs review» postponed (maintainer needs more info)

I can't confirm the bug, nor can I see how it can be reproduced. If someone can provide a step by step on how to make it happen, I'll commit this.

#5

I have the same problem...for me it only shows up on 404 pages...adding the case '':break; solved the problem for me.

#6

Status:postponed (maintainer needs more info)» closed (won't fix)

Hi,

With the release of Drupal 7, Drupal 5 is no longer receiving security updates, reviews, or development from many contributed modules. Since 5 is now considered a depreciated version, you really should seriously look into upgrading to Drupal 6 or 7. The newer versions of Drupal work better, have more support, and will be safer (literally! security patches!) for your website. We are currently working on a new release for Workflow to Drupal 7. In light of that, further support for Drupal 5 issues is infeasible at the moment. Please consider upgrading to Drupal 6 or 7 in the near future - you'll be glad you did.

- Bastlynn

nobody click here