This is not too bad because the menu topics already contain a lot of docs on this but still a few words can't hurt -- not to mention an @ingroup menu.

Comments

jhodgdon’s picture

Thanks! Good idea to add more information here...

But when I read this:

+++ b/core/lib/Drupal/Core/Menu/ContextualLinkInterface.php
@@ -9,6 +9,14 @@
+ * file. These YAML files contain a list of plugin definitions keyed by the
+ * plugin id. Each definition / link must define a route_name and a group

I went ... Really? I don't see any plugin definitions or plugin IDs there, or if they are, it isn't obvious. They're things like:

block_content.block_edit:
  title: 'Edit'
  group: block_content
  route_name: 'entity.block_content.canonical'

To me, "plugin definition" is a class...

I guess I see what you mean here but when I read that I went uh, what?

Let's see. What can we say. How about this:

These YAML files contain contextual link entries, keyed by an ID. Each entry gives the properties of an implicit contextual link plugin, as defined by this interface, with the ID being the plugin ID.

How about that to replace that sentence that begins with "These YAML files" in this patch?

jhodgdon’s picture

Status: Needs review » Needs work

Sorry, never updated issue status on this. Should we still fix this?

chx’s picture

> To me, "plugin definition" is a class...

Not really. The plugin definition can be a Doctrine annotation which is then stored in an object and then the plugin manager can reveal this to the rest of the system as just an array or another value object. But this is not necessary: it definitely can be in a YAML file or if you write a custom discovery as I did for the upcoming migration plugin can be a YAML file by itself.

Now, a plugin, that's a class, for sure.

I will look into this more.

jhodgdon’s picture

  1. +++ b/core/lib/Drupal/Core/Menu/ContextualLinkInterface.php
    @@ -9,6 +9,14 @@
    + * file. These YAML files contain a list of plugin definitions keyed by the
    + * plugin id. Each definition / link must define a route_name and a group
    

    Fair enough, yes I see what you mean -- these are actually plugin definitions... How about wording something like this:

    These YAML files contain a list of contextual link plugin definitions, keyed by plugin ID. Each definition must define....

  2. +++ b/core/lib/Drupal/Core/Menu/ContextualLinkInterface.php
    @@ -9,6 +9,14 @@
    + * and might define title, options and weight. See the getter methods on this
    

    Needs comma before "and".

priya.chat’s picture

Status: Needs work » Needs review
StatusFileSize
new769 bytes

Hello, I have tried to made some changes as commented by @jhodgdon. Please review it.

Status: Needs review » Needs work

The last submitted patch, 5: cli-5.patch, failed testing.

shreya shetty’s picture

Assigned: Unassigned » shreya shetty
shreya shetty’s picture

Assigned: shreya shetty » Unassigned
Status: Needs work » Needs review
StatusFileSize
new753 bytes
new901 bytes

Hi jhodgdon ,
Thank you for suggestion .I have made the changes accordingly.

jhodgdon’s picture

Status: Needs review » Needs work

Neither the patch in #5 nor the patch in #8 really did what was suggested in #4. Please try again.

Also by the way you need to say "ID" not "id", which I forgot to mention in #4.

And all documentation lines should be wrapped as close to 80 characters as possible without going over.

rang501’s picture

Status: Needs work » Needs review
StatusFileSize
new765 bytes
new1.23 KB

Hi!
I hope I got this right.
FYI, I made a slight change (grammatically it should be more correct): modulename.links.contextual.yml to module_name.links.contextual.yml

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

This looks great to me, thanks!

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.1.x and cherry-picked to 8.0.x. Thanks!

  • catch committed 9a9770c on 8.1.x
    Issue #2540136 by Shreya Shetty, rang501, chx, priya.chat: Improve...

  • catch committed b140baa on 8.0.x
    Issue #2540136 by Shreya Shetty, rang501, chx, priya.chat: Improve...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.