I can use entityreference fields to reference bean entities without problems, however when I want to display the bean using the "Rendered Entity" formatter, an "empty" bean is output. The view function of the bean plugin is never called.

As a workaround I have written a custom formatter just for beans, which I'll attach.

#6 1891210-view_callback-6.patch957 bytesguillaumev
PASSED: [[SimpleTest]]: [MySQL] 94 pass(es).
[ View ]
#1 entityreference_bean_formatter.txt722 bytesvalderama


valderama’s picture

new722 bytes

Btw, I am using these versions:
Entity API 7.x-1.0
Entity Reference 7.x-1.0
Bean 7.x-1.0-rc8

And attached is my formatter...

DamienMcKenna’s picture

This works for me with the latest 1.0 release of EntityReference. However, similar to #1858416: Rendered bean does not display the title when display settings indicate it should, it does not display the bean title, just the bean's content. Maybe there should be an option to include the title?

DamienMcKenna’s picture

Status:Active» Postponed (maintainer needs more info)

What field are you outputting? The title field currently is not displayed (see #1858416), so unless you have other fields it won't work.

valderama’s picture

Actually, I am using a bean which does not have fields, but its content is generated from the view function of the plugin. Like those bean-types: http://drupal.org/project/bean_twitter_pull and http://drupal.org/project/bean_tax

I can verify that fields attached to the bean are rendered indeed.

Any hints for how to fix this are welcome.. Thanks!

akalata’s picture

I ran into this as well -- could not get the single field on the bean to appear. I had used the existing field_body field, specified via Entity Reference and displayed via Display Suite. Creating a new field instead of re-using field_body worked for me.

guillaumev’s picture

Status:Postponed (maintainer needs more info)» Needs review
new957 bytes
PASSED: [[SimpleTest]]: [MySQL] 94 pass(es).
[ View ]

The same problem exists when you try to display a bean using views: given that BeanPlugin->view is never called, you might end up with just the field of the bean entity while what you want to display is actually the result of the call to BeanPlugin->view.

Here is a patch that fixes it for me (and should fix it as well for EntityReference I believe).

indytechcook’s picture

Status:Needs review» Fixed

Thanks for the patch. It's always to good think to keep implementing more parts of the entity api. Who knows what other integrations this fixes.


Status:Fixed» Closed (fixed)

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