Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
12 Jan 2009 at 20:00 UTC
Updated:
2 Jan 2014 at 23:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
kenorb commentedWhy is that?
It's a bug!
http://drupal.org/node/346264#comment-1220620
http://drupalbin.com/1059
Comment #2
heine commented@kenorb, if you believe this is a bug (and I do not), please file a bug report against code.
While the drupal_render api documentation might state "Calling this function twice returns NULL the second time.", I do not believe that to be useful. The key feature of drupal_render (and also responsible for this behaviour) is that drupal_render marks whatever it rendered as "printed", and does not process "printed" elements again.
This is a VERY useful feature as you can do this, without having $item['somepart'] rendered twice:
Comment #3
kenorb commentedWhen you making some patch, how do you know how many times drupal_render has been called?
Look at this patch: http://drupal.org/files/issues/simplenews_template.module.patch (at the end)
Question: How many?
Because I don't know;/
Comment #4
heine commentedPlease keep the issue focussed on the API documentation.
Comment #5
jhodgdonWell, probably drupal_render() should mention how it modifies its input, rather than just saying don't call it twice (i.e. say why).
Please start with Drupal 7.
Comment #6
jhodgdonAdding a short note (see #5) seems like a good Novice project
Comment #7
cfennell commentedHere's a patch that adds documentation to reflect @Heine's comment (#2) about the '#printed' flag.
Comment #8
cwgordon7 commentedLooks nice, thanks! This is rtbc. :)
Comment #9
webchickThis is a nice clarification. Committed to HEAD. Thanks!
Comment #10
cfennell commentedThanks, glad to help :)
Comment #11
jhodgdonThis change needs to be ported to the D6 doc as well.
Comment #12
rdrh555 commentedPatch to be completed today
Comment #13
rdrh555 commentedHere it is
Comment #14
jhodgdonThanks! This patch applies cleanly and looks good to me. Congratulations rdrh555 on (I think) your first core patch!
Comment #15
gábor hojtsyThanks, committed.