I have a date field that our accountant can use to put in a date of an invoice. However, when I test his role out and try to change the date, I get Date Invalid. When I am logged in with the superuser I have no trouble with this although I am getting some errors, as shown below.

array_key_exists() [<a href='function.array-key-exists'>function.array-key-exists</a>]: The first argument should be either a string or an integer in /var/www/vhosts/mysite.com/subdomains/mysite/httpdocs/sites/all/modules/workflow/workflow.module on line 275

and
Illegal offset type in /var/www/vhosts/mysite.com/subdomains/mysite/httpdocs/sites/all/modules/workflow/workflow.module on line 1576.

Please help! I really need to figure this out. It's driving me nuts and i need the functionality.

Becky

Comments

infojunkie’s picture

Version: 6.x-1.1 » 6.x-1.x-dev

Can you please try out the dev release and let me know if it works better?

beckyjohnson’s picture

OK. This kind of worked. I can now edit the date field when I am logged in as role accountant, which is great, but I'm also getting the error:

warning: Cannot use a scalar value as an array in /var/www/vhosts/mysite.org/subdomains/site/httpdocs/sites/all/modules/workflow_fields/workflow_fields.module on line 334.

Becky

presleyd’s picture

This is still the case. I have yet to find a way to manage a workflow w/o this module. Since there is no D7 port however I'm actively looking. I'm going to see if I can fix this warning at least and will post a patch if successful.

presleyd’s picture

Was an easy fix, the offending line looks like this:
$element = &$parent[$child];
and it had to be changed to
$element = $parent[$child];

However, some node reference fields aren't obeying the access rules placed on them. This is probably a new issue though.

beckyjohnson’s picture

Interesting, so where do I make this change in the code? What file are you editing?

presleyd’s picture

The error you listed gave a file and line number.

presleyd’s picture

Status: Active » Needs review

I'm not sure this fix is ideal. Hoping someone can help me figure out why everything is being passed by reference here.

presleyd’s picture

That removes the bug but it's not the source of the problem. Line 326 calls the function via:

  if (count($path) > 1) {
      _workflow_fields_hide_empty_fieldsets($form[$path[0]]);

The argument being passed $form[$path[0]] seems to be the problem.

seancorrales’s picture

Assigned: Unassigned » seancorrales