Closed (fixed)
Project:
Workflow
Version:
7.x-1.1
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Apr 2013 at 16:00 UTC
Updated:
21 Jun 2013 at 10:32 UTC
Jump to comment: Most recent file
Comments
Comment #1
nancydruWhat version of PHP are you using? I do not see this on 5.3.13.
Comment #2
robin.prieschl commentedI am using PHP 5.4.4.
I have just noticed that when I add a transition, the error goes away.
Comment #3
nancydruI'll see if I can try 5.4. There are many modules, including core, that have issues with 5.4.
Comment #4
robin.prieschl commentedYou are right, I have changed to PHP 5.3.14 and the error no longer appears.
Seems to only affect 5.4.
Comment #5
nancydruHmm,
$sids[$sid] = array_shift(workflow_get_workflow_states($options));looks to me like a variable is being passed. Or is it complaining that the $options array was passed into the function? If that's the case, try putting an & on it and see if the issue goes away.Comment #6
robin.prieschl commentedI have made the change. Unfortunately the error still comes up when I save changes.
Is anyone else having the same problem, or am I alone on this one.
Comment #7
nancydruThere probably aren't that many people on 7.x-1.1 yet, others may still experience it. Are you using PHP's STRICT error level?
Comment #8
robin.prieschl commentedPHP's STRICT was not enabled.
Enabling it yielded no difference.
I think for now I will run PHP 5.3.14.
Comment #9
phiscock commentedI'm getting this error as well running PHP 5.3.9
Comment #10
santimt commentedI had the same warning under PHP 5.4.13.
I fixed it with the following PHP change:
Change the line 1334 of workflow.module file to
$arrayVar = workflow_get_workflow_states($options);
$sids[$sid] = array_shift($arrayVar);
That is create a variable with the function return value, and use that variable instead of the function as the parameter of array_shift.
Reason of the warning http://stackoverflow.com/questions/2354609/strict-standards-only-variabl...
It's just a warning in the STRICT logging mode.
Comment #11
andypostWe have this pattern all over core. So simple to fix
Comment #12
andypostA bit more clean-up
Comment #13
nancydruCommitted with attribution. Thanks, Andy.
Comment #14
crbassett commentedI'm on Workflow 1.1 and PHP 5.4.6 and I'm still getting this error. Do I need to update to the dev version?
Comment #15
nancydruYes. Once a release is published, it can no longer be changed. That's why we show -dev releases. I'm hoping to create a 7.x-1.2 release soon.
Comment #17
a.milkovskyAndrey, thx for the #11, I made the same fix.