The menu.get method of the Menu service uses the Menus module's menu_tree_page_data function. This function returns a menu as it should be displayed in the current page. Some sub-items may be hidden, for example. As the notion of a "current page" is not relevant to a Web service call, I propose that this method uses the menu_tree_all_data function instead, which returns the complete menu tree, regardless of the current page. I believe this would be a more natural behaviour for this method.

It's a one-line change to the menu.inc file. Patch is attached. Sorry if the format if not good, I'm not very familiar with submitting patches.

CommentFileSizeAuthor
full_menu.patch95 bytesqbert72

Comments

marcingy’s picture

Status: Active » Needs work

Please roll a valid patch so as we can discuss this further

marcingy’s picture

Status: Needs work » Fixed

After review of what is happening yes this does make sense as we never have a page context as such. Patch committed.

marcingy’s picture

Status: Fixed » Closed (fixed)