This construct...

drupal_render(drupal_get_form('some_form'))

... is causing a bunch of strict warnings.

Comments

alpritt’s picture

Title: drupal_render($function()) causes strict warnings » drupal_render($function()) causes strict errors

From http://drupal.org/node/353069#comment-1552904 where this was introduced:

We should *not* be using drupal_render() in module code. Modules need to pass back arrays, not strings. There are very few legitimate uses for drupal_render() beyond drupal_render_page(). Just a few theme functions that need to ccarefully control their output. I added some drupal_render() calls because refactoring spaghetti like comment module is beyond the scope of this patch. I'll do it, but not here.

So a patch for this issue needs to fix code that *does* require drupal_render() (such as in install.php), and then make sure we have issues for fixing other occurrences The Right Way.

alpritt’s picture

Title: Strict warning: Only variables should be passed by reference » drupal_render($function()) causes strict warnings

Being pedantic.

alpritt’s picture

Title: drupal_render($function()) causes strict errors » drupal_render($function()) causes strict warnings

eh, I shouldn't rely on issues titles to describe bugs properly. Sample message:

Strict Standards: Only variables should be passed by reference in /Users/alanpritt/Sites/htdocs/head_headtpl3diff/install.php on line 435

mfb’s picture

See also #348448: Always report E_STRICT errors which fixes all the drupal_render() calls (if not The Right Way).

mfb’s picture

Status: Active » Closed (duplicate)