Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
API page: https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Menu!menu.api.php...
I'm seeing the following items in the menu items which aren't documented:
- load arguments
- id
- metadata
- class
- form_class
- deriver
- provider
Comment | File | Size | Author |
---|---|---|---|
#10 | remove-return-doc-2729455-10.patch | 794 bytes | Vinay15 |
Comments
Comment #2
Vinay15Comment #3
Vinay15Hi Joachim,
Can you suggest me some things, I am not sure about these.
- load arguments: is this same as drupal 7 load arguments parameter in hook_menu()?
- id: is this the machine name of the menu link?
- metadata: can this be simply saying "metadata about the menu link" ?
- class: is it MenuLinkDefaultForm ?
No guesses for the others.
Comment #4
joachim CreditAttribution: joachim commentedI'm not sure myself on most of these.
It looks like class and form class set the plugin class to be used for rendering the menu link, and for producing the menu link edit form respectively. In both cases, these are fully qualified class names.
Comment #5
joachim CreditAttribution: joachim commented> route_name: (optional) The route name to be used to build the path. Either the route_name or url element must be provided.
Also, that isn't true.
The user.logout link has neither.
Comment #6
joachim CreditAttribution: joachim commentedAlso, this hook has no return -- &$links is to be altered in place.
Comment #7
jhodgdonThis hook documentation is wrong in other ways... for instance, there is no return value. It's an alter hook, so you should modify the $links in place.
So, regarding the properties...
This is the method that actually gets the definitions that are passed into this hook:
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Plugin!Discovery!...
So what is in there is whatever is in the YAML files that define the menu links, plus 'provider' and 'id'.
For documentation on what is supposed to be in menu links YAML, we have
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Menu!menu.api.php...
and pages on drupal.org that it links to.
So, look there....
Comment #8
Vinay15So, should I remove @return from this hook and paste all the description in @return above @param?
Because the description is quite helpful to the reader.
Comment #9
joachim CreditAttribution: joachim commentedYou're right that we shouldn't lose the description from the @return, but it should move into the @param $links, because it tells you what you'll find in $links.
Comment #10
Vinay15I have removed the return doc and added the description to @param description.
Comment #11
jhodgdonThanks! Yes, that is the correct fix for the @param/@return sections. However, the patch doesn't address the problem in the issue summary yet (the missing properties).
Comment #12
Vinay15Comment #13
ashishdalviComment #15
nikunjkotechaComment #16
nikunjkotechanot good at documentation
Comment #23
Rithesh BK CreditAttribution: Rithesh BK at Valuebound for Valuebound commentedcurrently i am working on it ....
Comment #24
Rithesh BK CreditAttribution: Rithesh BK at Valuebound for Valuebound commentedlet me go through the documentation ....
Comment #25
Rithesh BK CreditAttribution: Rithesh BK at Valuebound for Valuebound commented@Vinay15 As the patch mentioned in the #10 is good to go as the documentation says that the links will be altered based on the function which is mentioned below
Comment #26
Rithesh BK CreditAttribution: Rithesh BK at Valuebound for Valuebound commented@Vinay15 As the patch mentioned in the #10 is good to go as the documentation says that the links will be altered based on the function which is mentioned below
Comment #27
joachim CreditAttribution: joachim commentedBased on #11, this is still needing work.
Comment #29
saurabh-2k17 CreditAttribution: saurabh-2k17 at Srijan | A Material+ Company for Drupal India Association commentedHi @joachim i tried adding the items name but i am not able to describe them (only that they are optional). A small description for each would be helpful to update the patch and close this issue.Thanks
Comment #30
saurabh-2k17 CreditAttribution: saurabh-2k17 at Srijan | A Material+ Company for Drupal India Association commented