Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
theme system
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
16 Jul 2014 at 16:54 UTC
Updated:
15 Aug 2014 at 14:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jhodgdonThanks, good idea to fix this! If you find other cases of documentation doing that, please file new issues. Let's get drupal_render() fixed on this issue.
By the way, the Drupal 7 version of the function doesn't have this example in it.
Comment #2
pushpinderchauhan commentedPlease review.
Comment #3
jhodgdonPerfect! Thanks!
Comment #4
alexpottThe thing is that it does not have to be an array - should we be documenting this here?
Comment #5
jhodgdonIt doesn't *have* to be an array, but it usually is an array. I don't think it's a bad idea to have the examples changed to use arrays? We're not changing the documentation that talks about the class attribute, just some code samples that have to do with using the #theme_wrappers property anyway.
Of course, if we're doing that, I just noticed that one of the examples, just below where this patch ends, is still not an array:
Comment #6
pushpinderchauhan commentedDid changes as mentioned in #5, please review updated patch.
Comment #7
jhodgdonI think this is OK... alexpott: see #5 for why I think this should probably be done, but I'll let you make the decision.
Comment #8
webchickComment #9
samuel.mortensonIf it helps, the functions in form.inc that expect class to be an array are:
I'm not sure if we should ever suggest that people set class to a string given the amount of functions that rely on it being an array.
Comment #10
alexpottSo let's also remove all instances where we don't set class to an array...
are the only places I can find where we do this.
Comment #11
alexpottComment #12
undertext commentedComment #13
undertext commentedComment #15
undertext commentedArgh, unix-style line endings. Trying one more time
Comment #16
undertext commentedComment #17
jhodgdonThe patch looks good to me, and fixes all locations identified by alexpott in#10. Plus, testbot agrees that the tests still pass. Should be good to go, thanks!
Comment #18
alexpottCommitted 0d99a0c and pushed to 8.x. Thanks!
Comment #21
m1r1k commented