API page: https://api.drupal.org/api/drupal/includes%21menu.inc/function/menu_tree...
Like stated by Matt-H on January 27, 2012 and sujoyit2005 on January 26, 2014:
The first line of the documentation for this function currently says, "Returns a rendered menu tree." This was true in previous versions, but in Drupal 7, the return is "a structured array to be rendered by drupal_render()." Therefore, the opening documentation should change as well.
Comment | File | Size | Author |
---|---|---|---|
#6 | 2204873-fix-documentation-menu-tree-output-6.patch | 433 bytes | sandipmkhairnar |
#2 | 2204873-fix-documentation-menu-tree-output-2.patch | 440 bytes | sandipmkhairnar |
Comments
Comment #1
jhodgdonThanks! Needs to be fixed in 8.x first, then backported to 7.x. (Or more likely the same patch can be used for both, since the functions appear to be identical).
Comment #2
sandipmkhairnar CreditAttribution: sandipmkhairnar commentedUpdated code as per comments.
Comment #3
sandipmkhairnar CreditAttribution: sandipmkhairnar commentedComment #4
sandipmkhairnar CreditAttribution: sandipmkhairnar commentedComment #5
jhodgdonThanks... but:
We lost the information here about what the function does, which is to set up to render a menu tree. This statement is what a lot of functions do (return a render array), not specific to what this function does (do that for a menu tree).
And really, the @return already talks about the structure of the returned value. So ... Maybe the first line should say something more like:
Creates an output structure for rendering a menu tree.
or something similar?
Comment #6
sandipmkhairnar CreditAttribution: sandipmkhairnar commentedComment #7
sandipmkhairnar CreditAttribution: sandipmkhairnar commentedComment #8
jhodgdonThanks!
Comment #9
alexpottCommitted 29b519c and pushed to 8.x. Thanks!
Comment #10
jhodgdonCommitted the same patch (with a little fuzz) also to 7.x. Thanks!