Download & Extend

drupal_render($function()) causes strict warnings

Project:Drupal core
Version:7.x-dev
Component:other
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

This construct...

drupal_render(drupal_get_form('some_form'))

... is causing a bunch of strict warnings.

Comments

#1

Title:Strict warning: Only variables should be passed by reference» 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.

#2

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

Being pedantic.

#3

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

#4

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

#5

Status:active» closed (duplicate)

Let's resolve this in #348448: Always report E_STRICT errors

nobody click here