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.
This probably also applies to many other ways of rendering a bean.
Comment | File | Size | Author |
---|---|---|---|
#7 | bean-entity_render_contextual_links_fix-1954950-7-D7.patch | 584 bytes | robschmitt |
#4 | bean-entity_render_contextual_links_fix-1954950-4-D7.patch | 409 bytes | Ericmaster |
Comments
Comment #1
saltednutBeans delivered through panels also seem to have this problem.
Comment #2
DamienMcKennaI believe this is a side-effect of the bean title not being displayed correctly and this may be a duplicate of #1858416: Rendered bean does not display the title when display settings indicate it should.
Comment #3
saltednutI am only seeing contextual links on the Bean when the title is rendered. If no title is rendered, there are no contextual links. This is a problem with core and is often handled through theme preprocessing. Other modules, such as Views, take a heavier handed approach to the contextual links problem and take special care to render these contextual links in their own way. I am thinking we would like to figure out a way to show contextual links even when there is no title present on the Beans. I'm open to suggestions - I think there are multiple approaches we could take.
Comment #4
Ericmaster CreditAttribution: Ericmaster commentedContextual links are added in the hook_block_view only, so I copied it over to the render function within the bean entity class which worked great for me.
Comment #5
Ericmaster CreditAttribution: Ericmaster commentedComment #7
robschmitt CreditAttribution: robschmitt commentedRerolled the patch in #4 to make up for the missing $content_key variable. Not sure where that was coming form. Works for me now.
Comment #8
askibinski CreditAttribution: askibinski at Merge commentedSiimple patch, works like a charm!
Comment #9
anthonylindsay CreditAttribution: anthonylindsay commentedI've just tried this patch with the usecase of a bean being rendered as the Views header (default viewmode). Alas, I got no contextual links.
Comment #10
Alexandre360 CreditAttribution: Alexandre360 commentedDon't know what you missed but it perfectly works for beans embed in an entityreference via a paragraphs (so a pretty complex configuration).
Comment #11
PolThe patch works on our side too.Comment #12
PolThe patch is not working. Sorry for the previous comment.
Comment #13
PolWe are using this now #2084823: contextual links for entity view in favor of this patch.
Comment #14
PolWhat I meant when I said that this patch is not working was not very accurate.
What I wanted to say is that the patch is fine, and if we want to display Contextual Links by default, then the patch is incomplete.
The default bean template has to be updated too.
Please see #2084823: contextual links for entity view for a more up to date patch and discussions.