This probably also applies to many other ways of rendering a bean.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

saltednut’s picture

Beans delivered through panels also seem to have this problem.

DamienMcKenna’s picture

I 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.

saltednut’s picture

I 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.

Ericmaster’s picture

Contextual 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.

Ericmaster’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: bean-entity_render_contextual_links_fix-1954950-4-D7.patch, failed testing.

robschmitt’s picture

Status: Needs work » Needs review
FileSize
584 bytes

Rerolled the patch in #4 to make up for the missing $content_key variable. Not sure where that was coming form. Works for me now.

askibinski’s picture

Siimple patch, works like a charm!

anthonylindsay’s picture

Status: Needs review » Needs work

I'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.

Alexandre360’s picture

Status: Needs work » Needs review

Don't know what you missed but it perfectly works for beans embed in an entityreference via a paragraphs (so a pretty complex configuration).

Pol’s picture

Status: Needs review » Reviewed & tested by the community

The patch works on our side too.

Pol’s picture

Status: Reviewed & tested by the community » Needs work

The patch is not working. Sorry for the previous comment.

Pol’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#2084823: contextual links for entity view

We are using this now #2084823: contextual links for entity view in favor of this patch.

Pol’s picture

What 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.