Needs work
Project:
Drupal core
Version:
main
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 May 2016 at 16:15 UTC
Updated:
13 Aug 2024 at 16:52 UTC
Jump to comment: Most recent, Most recent file
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 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 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 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 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 commentedcurrently i am working on it ....
Comment #24
rithesh bk commentedlet me go through the documentation ....
Comment #25
rithesh bk 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 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 commentedBased on #11, this is still needing work.
Comment #29
saurabh-2k17 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 commentedComment #37
quietone commentedThere is fair bit of research that needs to be done in order to document these values. I am removing the novice tag.