API page: http://api.drupal.org/api/drupal/includes%21menu.inc/function/menu_get_i...
Based on the following code, the function can return false.
if ($map === FALSE) {
$router_items[$path] = FALSE;
return FALSE;
}
Return value
The router item, an associate array corresponding to one row in the menu_router table.
Should be something like:
The router item, an associate array corresponding to one row in the menu_router table, or FALSE.
Comment | File | Size | Author |
---|---|---|---|
#9 | drupal-menu-get-item-docs-1802760-9-d8.patch | 1.84 KB | mkadin |
#7 | drupal-menu-get-item-docs-1802760-7-d8.patch | 1.49 KB | mkadin |
#4 | drupal-menu-get-item-docs-1802760-4-d7.patch | 1.54 KB | mkadin |
#2 | drupal-menu-get-item-docs-1802760-2-d8.patch | 1.56 KB | mkadin |
Comments
Comment #1
jhodgdonThanks for noticing and reporting this! The documentation of the return value should indicate under what conditions FALSE can be returned.
Comment #2
mkadin CreditAttribution: mkadin commentedHere you go. Didn't want to repeat the explanation from _menu_translate() docs.
Did a little English work in the _menu_translate() docs as well.
D7 backport coming shortly.
Comment #3
mkadin CreditAttribution: mkadin commentedComment #4
mkadin CreditAttribution: mkadin commentedD7 patch as well.
Comment #6
jhodgdonPlease read http://drupal.org/node/1319154#multiple-versions regarding uploading D7 patches too soon (however, thanks for the patches!).
Regarding the d8 patch, I think we need to go back up one line and fix one thing:
associate -> associative
Also, the whole thing ... well it still seemed a bit confusing to me. With this patch, the @return reads:
The router item, an associate array corresponding to one row in the
menu_router table or FALSE. The value of key map holds the loaded objects.
The value of key access is TRUE if the current user can access this page.
The values for key title, page_arguments, access_arguments, and
theme_arguments will be filled in based on the database values and the
objects loaded. If an error occurs when objects are loaded via
_menu_translate(), FALSE will be returned.
I had a lot of trouble making sense of this paragraph -- I would suggest reworking it like this:
Either the router item or, if an error occurs, FALSE. A router item is an associative array corresponding to...
Comment #7
mkadin CreditAttribution: mkadin commentedHows this?
Comment #8
jhodgdonBetter, thanks! A few small typographical errors:
- There should be only one space after "." at ends of sentences.
- "associate array" => "associative array"
- I think it would be even easier to read if it said "The value *corresponding* to key 'map' is..." etc. (obviously, without the **).
Comment #9
mkadin CreditAttribution: mkadin commentedAgreed, I didn't like the way the key value pairs were describe either. Here's a shot at it.
Comment #10
jhodgdonI like this version much better, thanks! Provisionally RTBC (pending bot), and I'll get it committed sometime soon (probably tomorrow, I'm done with commits for today).
Comment #11
jhodgdonThanks! Committed to 8.x and 7.x.