Commit 27dc2b49 authored by webchick's avatar webchick

Issue #2076141 by lokapujya: Unneeded dance around 'Node'/'Content' entity...

Issue #2076141 by lokapujya: Unneeded dance around 'Node'/'Content' entity label in views integration code.
parent 50ce328c
......@@ -177,8 +177,7 @@ function field_views_field_default_views_data(FieldInterface $field) {
);
}
// Override Node to Content.
$group_name = ($entity_info['label'] == t('Node')) ? t('Content') : $entity_info['label'];
$group_name = $entity_info['label'];
// Get the list of bundles the field appears in.
$bundles_names = $field->getBundles();
// Build the list of additional fields to add to queries.
......
......@@ -490,11 +490,10 @@ function file_field_views_data_views_data_alter(array &$data, FieldInterface $fi
$pseudo_field_name = 'reverse_' . $field['field_name'] . '_' . $entity_type;
list($label,) = field_views_field_label($entity_type, $field['field_name']);
$entity_label = ($entity_info['label'] == t('Node')) ? t('Content') : $entity_info['label'];
$data['file_managed'][$pseudo_field_name]['relationship'] = array(
'title' => t('@entity using @field', array('@entity' => $entity_label, '@field' => $label)),
'help' => t('Relate each @entity with a @field set to the file.', array('@entity' => $entity_label, '@field' => $label)),
'title' => t('@entity using @field', array('@entity' => $entity_info['label'], '@field' => $label)),
'help' => t('Relate each @entity with a @field set to the file.', array('@entity' => $entity_info['label'], '@field' => $label)),
'id' => 'entity_reverse',
'field_name' => $field['field_name'],
'entity_type' => $field['entity_type'],
......
......@@ -44,11 +44,10 @@ function image_field_views_data_views_data_alter(array &$data, FieldInterface $f
$pseudo_field_name = 'reverse_' . $field['field_name'] . '_' . $entity_type;
list($label,) = field_views_field_label($entity_type, $field['field_name']);
$entity_label = ($entity_info['label'] == t('Node')) ? t('Content') : $entity_info['label'];
$data['file_managed'][$pseudo_field_name]['relationship'] = array(
'title' => t('@entity using @field', array('@entity' => $entity_label, '@field' => $label)),
'help' => t('Relate each @entity with a @field set to the image.', array('@entity' => $entity_label, '@field' => $label)),
'title' => t('@entity using @field', array('@entity' => $entity_info['label'], '@field' => $label)),
'help' => t('Relate each @entity with a @field set to the image.', array('@entity' => $entity_info['label'], '@field' => $label)),
'id' => 'entity_reverse',
'field_name' => $field['field_name'],
'entity_type' => $field['entity_type'],
......
......@@ -440,11 +440,10 @@ function taxonomy_field_views_data_views_data_alter(array &$data, FieldInterface
$pseudo_field_name = 'reverse_' . $field['field_name'] . '_' . $entity_type;
list($label,) = field_views_field_label($entity_type, $field['field_name']);
$entity_label = ($entity_info['label'] == t('Node')) ? t('Content') : $entity_info['label'];
$data['taxonomy_term_data'][$pseudo_field_name]['relationship'] = array(
'title' => t('@entity using @field', array('@entity' => $entity_label, '@field' => $label)),
'help' => t('Relate each @entity with a @field set to the term.', array('@entity' => $entity_label, '@field' => $label)),
'title' => t('@entity using @field', array('@entity' => $entity_info['label'], '@field' => $label)),
'help' => t('Relate each @entity with a @field set to the term.', array('@entity' => $entity_info['label'], '@field' => $label)),
'id' => 'entity_reverse',
'field_name' => $field['field_name'],
'entity_type' => $field['entity_type'],
......
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