When changing the Workflow-State I get the following warning:

Strict warning: Only variables should be passed by reference in workflow_tab_page() (line 26 of C:\xampp\htdocs\niku_formular_online\sites\all\modules\contrib\workflow\workflow.pages.inc).

See the screenshot attached.

Comments

shendric’s picture

I would like to second this report. When I click the Workflow tab of a node, I get the same error.

shendric’s picture

Just looked at the code, and I'm confused, because it doesn't look like anything is getting passed by reference:

$output .= drupal_render(drupal_get_form('workflow_tab_form', $node, $workflow->wid, $states, $current));

*shrug*

shendric’s picture

This forum discussion might be useful in figuring out how to fix the bug:

http://drupal.org/node/1064792

sbrege’s picture

Hi shendric,

thanks for the hint, but I'm actually not so good in php.

Is there a chance to get the bug fixed? Can the maintainer please fix it?

Thanks,

Stefan

fire-wolf’s picture

Status: Active » Needs review

Hello, All!
Problem is that Drupal needs a variable to render. So the combination drupal_render(drupal_get_form(...)) is bad.
There are two files to edit:
workflow.pages.inc (line 26)

  $output .= drupal_render(drupal_get_form('workflow_tab_form', $node, $workflow->wid, $states, $current));

change to:

  $form = drupal_get_form('workflow_tab_form', $node, $workflow->wid, $states, $current);
  $output .= drupal_render($form);

and workflow_admin_ui/workflow_admin_ui.module (line 756)

    $output .= drupal_render(drupal_get_form('workflow_admin_ui_types_form'));

change to:

    $form = drupal_get_form('workflow_admin_ui_types_form');
    $output .= drupal_render($form);
adshill’s picture

I can confirm this has worked for us.

Morten Najbjerg’s picture

StatusFileSize
new2.23 KB

#5 worked for me too. Here's a patch.

sbrege’s picture

StatusFileSize
new224.27 KB

#5 worked for me too

I've edited the file by hand, because the patch from #7 had problems (see screenshot)

Bastlynn’s picture

StatusFileSize
new2.04 KB

Looks like you ran your diff from the modules folder, not the workflow folder Morten. I've tweaked the patch for that directory difference. Otherwise, looks good and has been committed on 7.x-1.x-dev branch.

Bastlynn’s picture

Status: Needs review » Fixed

Thanks all :)

adshill’s picture

Good work Firewolf :)

Status: Fixed » Closed (fixed)

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

alexander allen’s picture

Worked for me, thank you.

nabajit’s picture

Issue summary: View changes

I also was getting the same issue, while rendering user menu. My code is -

Before -
$tree = menu_tree_all_data('user-menu');
$html = drupal_render(menu_tree_output($tree));

After making these to :
$tree = menu_tree_all_data('user-menu');
$menu = menu_tree_output($tree);
$html = render($menu);

it worked perfectly.

Thanks All.

drupalmani28’s picture

#5 is worked fine for me. Thanks

geocalleo’s picture

#5 worked for me.

bisw’s picture

#5 worked for me.

johnv’s picture

@bisw, are you still at version 1.0?