Commit e47409be authored by jmuzz's avatar jmuzz
Browse files

Merge branch '7.x-1.x' of git.drupal.org:project/field_collection into 7.x-1.x

parents 52b09beb 40072ad5
......@@ -14,20 +14,23 @@
*/
function field_collection_field_views_data($field) {
$data = field_views_field_default_views_data($field);
$field_name = $field['field_name'];
foreach ($data as $table_name => $table_data) {
foreach ($table_data as $field_name => $field_data) {
// Only operate on the "field_api_field_name"_value column.
if (strrpos($field_name, '_value') === (strlen($field_name) - strlen('_value'))) {
$data[$table_name][$field_name]['relationship'] = array(
'handler' => 'field_collection_handler_relationship',
'base' => 'field_collection_item',
'base field' => 'item_id',
'label' => t('field collection item from !field_name', array('!field_name' => $field['field_name'])),
'field_name' => $field['field_name'],
);
}
}
if (isset($data['field_data_' . $field_name])) {
$data['field_data_' . $field_name][$field_name . '_value']['relationship'] = array(
'handler' => 'field_collection_handler_relationship',
'base' => 'field_collection_item',
'base field' => 'item_id',
'label' => t('field collection item from !field_name', array('!field_name' => $field['field_name'])),
'field_name' => $field['field_name'],
);
$data['field_revision_' . $field_name][$field_name . '_revision_id']['relationship'] = array(
'handler' => 'field_collection_handler_relationship',
'base' => 'field_collection_item_revision',
'base field' => 'revision_id',
'label' => t('field collection item revision from !field_name', array('!field_name' => $field['field_name'])),
'field_name' => $field['field_name'],
);
}
foreach ($field['bundles'] as $entity_type => $bundles) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment