Posted by Xano on October 20, 2012 at 10:24am
4 followers
| Project: | Documentation |
| Component: | API documentation files |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Xano |
| Status: | needs work |
| Issue tags: | FAPI reference |
Issue Summary
The FAPI docs say form elements' #theme property should be a string, but this property should be an array for *any* renderable element.
Comments
#1
Patch for Drupal 8 that fixes the documentation. Should work for Drupal 7 as well.
#2
The last submitted patch, documentation_1818420_00.patch, failed testing.
#3
The change isn't correct either. It *can* be an array, but only because theme() also accepts an array. But this is a special case that is very seldomly used. Of 190 uses of "'#theme' in core, I've found exactly two that use an array.
so if anything, it should only documented that it is also possible to specify an array, maybe with a reference to the theme() documentation.
#4
The FAPI reference is in the Documentation project repo