For some dumb reason, I get the following at the top of every page:

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.

I am using the workflow module. I am not sure why this is getting triggered.

CommentFileSizeAuthor
#5 restore_parameters.patch1.54 KBjg-1

Comments

pearcec’s picture

workflow.module is using strstr which ends up matching on an empty section. What happens is when CakePHP is invoked it trashes the _GET['path'] variable. So we can just save it and restore it.

// Save _GET['path'] for proper help
$savePath = $_GET['path];

// Execute CakePHP action

$content = $cakeDispatcher->get($parameters['url']);

// Restore _GET['path'] for proper help
$_GET['path] = $savePath;
?>

pearcec’s picture

workflow.module is using strstr which ends up matching on an empty section. What happens is when CakePHP is invoked it trashes the _GET['path'] variable. So we can just save it and restore it.

// Save _GET['path'] for proper help
$savePath = $_GET['path];

// Execute CakePHP action

$content = $cakeDispatcher->get($parameters['url']);

// Restore _GET['path'] for proper help
$_GET['path] = $savePath;
?>

pearcec’s picture

workflow.module is using strstr which ends up matching on an empty section. What happens is when CakePHP is invoked it trashes the _GET['path'] variable. So we can just save it and restore it.

// Save _GET['q'] for proper help
$savePath = $_GET['q'];

// Execute CakePHP action

$content = $cakeDispatcher->get($parameters['url']);

// Restore _GET['q'] for proper help
$_GET['q'] = $savePath;
?>

pearcec’s picture

gah! anyway to delete the first two comments? I didn't think they submitted, and I realized it isn't path but q that needs saving. Anyway, you get the picture.

jg-1’s picture

Status: Active » Needs review
StatusFileSize
new1.54 KB

Both 'q' and 'task' $_REQUEST params are set for removal on line 303 in drake.module:

	$cakeDispatcher->setIgnoreParameters(array('q', 'task'));

They are removed as part of the cake dispatcher's _start() function (lines 284-291) in lib/cake_embedded_dispatcher.class.php:

		// Remove unnecessary parameters for CakePHP
		
		if (isset($this->ignoreParameters))
		{
			foreach($this->ignoreParameters as $parameter)
			{
				unset($_REQUEST[$parameter]);
				unset($_GET[$parameter]);
			}
		}

I've attached a patch file that does three things:

  1. Modifies the setIgnoredParameters function to store key/value pairs.
  2. Unsets the keys.
  3. Restores the key/value pairs as part of the _finish() function.

This solves my workflow conflict.

pearcec’s picture

Status: Needs review » Reviewed & tested by the community

I patched it and it works like a champ. Thanks.