Closed (fixed)
Project:
Examples for Developers
Version:
8.x-1.x-dev
Component:
Contextual Links Example
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Oct 2011 at 06:26 UTC
Updated:
24 Jun 2012 at 22:01 UTC
Comments
Comment #1
rfayComment #2
David_Rothstein commentedYup, this is due to a bug which recently appeared in Drupal 8 core. See #1304470: Add tests for module-provided contextual links on blocks
Once that is fixed, presumably the example code here will go back to working (unless the fix involves an API change, of course).... So I guess this issue should be left open until the core issue is fixed?
Comment #3
rfayPerhaps we should get some of the tests from here into core? Sounds like core doesn't have adequate tests for contextual links.
Comment #4
micahw156Are you guys sure this is limited to Drupal 8? I've just spent three hours trying to add contextual links to a module-provided block in Drupal 7 to no avail. I finally found the contextual links example block and verified that my code follows the example. The next Google search brought me here. I don't want to pull this issue off-topic, but I'm commenting here because it's the closest thing I've found to an explanation for my problem.
Also, I did not change the version on this issue intentionally. For some reason, only 6.x and 7.x branches are available to me, and it was set to "none" when I got here.
Comment #5
rfay8.x-1.x release has been removed, partially because of never-can-catch-up issues like this one.
The way to see if the Contextual Links example works is to try it out; just enable it and see if it works. It is currently passing tests: http://qa.drupal.org/pifr/test/136969
Comment #6
rfay#4, @micahw156: I enabled it and it worked fine. Don't forget to make sure you have contextual enabled and that you may need to rebuild your caches (menu cache).
To test the OP on this for 7.x-1.x, enable the "Contextual Links Example" block, and you'll see that the dropdown does now include an "Edit object" menu link. The node/%/example-action is also working, as is the /examples/contextual-links
Marking fixed as the 8.x issue will have to be sorted out later. We've emptied the 8.x branch in part because of critical issues like this that aren't worth fixing at this point.
Comment #7
rfay