Hi,
I have a content type called 'event' which has 2 different media fields: 'video' and 'audio'. When we try to create a view that involves the files from both fields getting rendered (so we create the relationship from the node to field_content_audio and field_content_video and in the field list, we select File: Rendered Entity), what happens is that whichever is selected first, that is the one that will get rendered for *both* fields (so if I had placed video first, both audio and video would show the rendered video, or video id, etc). Below is my exported view:
$view = new view;
$view->name = 'media_landing';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Media Landing';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Media Landing';
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'mini';
$handler->display->display_options['pager']['options']['items_per_page'] = '50';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['expose']['items_per_page_options_all'] = 0;
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Relationship: Content: Audio (field_content_audio:fid) */
$handler->display->display_options['relationships']['field_content_audio_fid']['id'] = 'field_content_audio_fid';
$handler->display->display_options['relationships']['field_content_audio_fid']['table'] = 'field_data_field_content_audio';
$handler->display->display_options['relationships']['field_content_audio_fid']['field'] = 'field_content_audio_fid';
$handler->display->display_options['relationships']['field_content_audio_fid']['required'] = 0;
/* Relationship: Content: Video (field_content_video:fid) */
$handler->display->display_options['relationships']['field_content_video_fid']['id'] = 'field_content_video_fid';
$handler->display->display_options['relationships']['field_content_video_fid']['table'] = 'field_data_field_content_video';
$handler->display->display_options['relationships']['field_content_video_fid']['field'] = 'field_content_video_fid';
$handler->display->display_options['relationships']['field_content_video_fid']['required'] = 0;
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = 0;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = 0;
$handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title']['alter']['html'] = 0;
$handler->display->display_options['fields']['title']['hide_empty'] = 0;
$handler->display->display_options['fields']['title']['empty_zero'] = 0;
$handler->display->display_options['fields']['title']['link_to_node'] = 1;
/* Field: File: Rendered File */
$handler->display->display_options['fields']['rendered_entity']['id'] = 'rendered_entity';
$handler->display->display_options['fields']['rendered_entity']['table'] = 'views_entity_file';
$handler->display->display_options['fields']['rendered_entity']['field'] = 'rendered_entity';
$handler->display->display_options['fields']['rendered_entity']['relationship'] = 'field_content_video_fid';
$handler->display->display_options['fields']['rendered_entity']['label'] = 'Rendered Video File';
$handler->display->display_options['fields']['rendered_entity']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['rendered_entity']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['rendered_entity']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['rendered_entity']['alter']['external'] = 0;
$handler->display->display_options['fields']['rendered_entity']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['rendered_entity']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['rendered_entity']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['rendered_entity']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['rendered_entity']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['rendered_entity']['alter']['more_link'] = 0;
$handler->display->display_options['fields']['rendered_entity']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['rendered_entity']['alter']['trim'] = 0;
$handler->display->display_options['fields']['rendered_entity']['alter']['html'] = 0;
$handler->display->display_options['fields']['rendered_entity']['element_label_colon'] = 1;
$handler->display->display_options['fields']['rendered_entity']['element_default_classes'] = 1;
$handler->display->display_options['fields']['rendered_entity']['hide_empty'] = 0;
$handler->display->display_options['fields']['rendered_entity']['empty_zero'] = 0;
$handler->display->display_options['fields']['rendered_entity']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['rendered_entity']['link_to_entity'] = 1;
$handler->display->display_options['fields']['rendered_entity']['display'] = 'id';
$handler->display->display_options['fields']['rendered_entity']['view_mode'] = 'media_large';
/* Field: File: Rendered File */
$handler->display->display_options['fields']['rendered_entity_1']['id'] = 'rendered_entity_1';
$handler->display->display_options['fields']['rendered_entity_1']['table'] = 'views_entity_file';
$handler->display->display_options['fields']['rendered_entity_1']['field'] = 'rendered_entity';
$handler->display->display_options['fields']['rendered_entity_1']['relationship'] = 'field_content_audio_fid';
$handler->display->display_options['fields']['rendered_entity_1']['label'] = 'Rendered Audio File';
$handler->display->display_options['fields']['rendered_entity_1']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['rendered_entity_1']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['rendered_entity_1']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['rendered_entity_1']['alter']['external'] = 0;
$handler->display->display_options['fields']['rendered_entity_1']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['rendered_entity_1']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['rendered_entity_1']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['rendered_entity_1']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['rendered_entity_1']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['rendered_entity_1']['alter']['more_link'] = 0;
$handler->display->display_options['fields']['rendered_entity_1']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['rendered_entity_1']['alter']['trim'] = 0;
$handler->display->display_options['fields']['rendered_entity_1']['alter']['html'] = 0;
$handler->display->display_options['fields']['rendered_entity_1']['element_label_colon'] = 1;
$handler->display->display_options['fields']['rendered_entity_1']['element_default_classes'] = 1;
$handler->display->display_options['fields']['rendered_entity_1']['hide_empty'] = 0;
$handler->display->display_options['fields']['rendered_entity_1']['empty_zero'] = 0;
$handler->display->display_options['fields']['rendered_entity_1']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['rendered_entity_1']['link_to_entity'] = 1;
$handler->display->display_options['fields']['rendered_entity_1']['display'] = 'id';
$handler->display->display_options['fields']['rendered_entity_1']['view_mode'] = 'media_large';
/* Sort criterion: Content: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
$handler->display->display_options['filter_groups']['operator'] = 'OR';
$handler->display->display_options['filter_groups']['groups'] = array(
1 => 'AND',
2 => 'AND',
);
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Video (field_content_video:fid) */
$handler->display->display_options['filters']['field_content_video_fid_1']['id'] = 'field_content_video_fid_1';
$handler->display->display_options['filters']['field_content_video_fid_1']['table'] = 'field_data_field_content_video';
$handler->display->display_options['filters']['field_content_video_fid_1']['field'] = 'field_content_video_fid';
$handler->display->display_options['filters']['field_content_video_fid_1']['operator'] = 'not empty';
$handler->display->display_options['filters']['field_content_video_fid_1']['group'] = 1;
/* Filter criterion: Content: Audio (field_content_audio:fid) */
$handler->display->display_options['filters']['field_content_audio_fid_1']['id'] = 'field_content_audio_fid_1';
$handler->display->display_options['filters']['field_content_audio_fid_1']['table'] = 'field_data_field_content_audio';
$handler->display->display_options['filters']['field_content_audio_fid_1']['field'] = 'field_content_audio_fid';
$handler->display->display_options['filters']['field_content_audio_fid_1']['operator'] = 'empty';
$handler->display->display_options['filters']['field_content_audio_fid_1']['group'] = 1;
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status_1']['id'] = 'status_1';
$handler->display->display_options['filters']['status_1']['table'] = 'node';
$handler->display->display_options['filters']['status_1']['field'] = 'status';
$handler->display->display_options['filters']['status_1']['value'] = '1';
$handler->display->display_options['filters']['status_1']['group'] = 2;
/* Filter criterion: Content: Video (field_content_video:fid) */
$handler->display->display_options['filters']['field_content_video_fid']['id'] = 'field_content_video_fid';
$handler->display->display_options['filters']['field_content_video_fid']['table'] = 'field_data_field_content_video';
$handler->display->display_options['filters']['field_content_video_fid']['field'] = 'field_content_video_fid';
$handler->display->display_options['filters']['field_content_video_fid']['operator'] = 'empty';
$handler->display->display_options['filters']['field_content_video_fid']['group'] = 2;
/* Filter criterion: Content: Audio (field_content_audio:fid) */
$handler->display->display_options['filters']['field_content_audio_fid']['id'] = 'field_content_audio_fid';
$handler->display->display_options['filters']['field_content_audio_fid']['table'] = 'field_data_field_content_audio';
$handler->display->display_options['filters']['field_content_audio_fid']['field'] = 'field_content_audio_fid';
$handler->display->display_options['filters']['field_content_audio_fid']['operator'] = 'not empty';
$handler->display->display_options['filters']['field_content_audio_fid']['group'] = 2;
/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'media-landing';
$translatables['media_landing'] = array(
t('Master'),
t('Media Landing'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Items per page'),
t('- All -'),
t('Offset'),
t('file from field_content_audio'),
t('file from field_content_video'),
t('Rendered Video File'),
t('Rendered Audio File'),
t('Page'),
);
I'm trying to figure out if this is a media issue or a file_entity issue and where in there it could be coming from and will update this issue if I find out something.
Comments
Comment #1
btmash commentedMy mistake, this was tagged in the wrong project. After some initial debugging, it seems that the issue stems from the entity module and it's views field handlers. Somewhere in EntityFieldHandlerHelper::get_value, the entity field value it *should* be looking at does not occur and it looks at the first one that is in place. I'll update this issue as I find out more.
Comment #2
btmash commentedTried today with the dev branch of entityapi and same issue.
Comment #3
tbenice commentedSame issue. This seems like a pretty basic need. Bumping it up.
Comment #4
geek-merlincrosslinking dup: (we might close one)
#1796110: Rendered entity fields show same result
also see
#1796102: Views caching of rendered entity field misarchitected, leading to unexpected results.
Comment #5
fagoyeah, let's handle this in #1796110: Rendered entity fields show same result which has a patch.