Commit 082b123f authored by webchick's avatar webchick

Revert "Issue #2399931 by dawehner, yched: Generic entity api field handler...

Revert "Issue #2399931 by dawehner, yched: Generic entity api field handler should live in views module not in field module"

Oops. Wrong patch!

This reverts commit 938051c4.
parent 938051c4
......@@ -11,7 +11,7 @@
* Implements hook_field_views_data().
*/
function entity_reference_field_views_data(FieldStorageConfigInterface $field_storage) {
$data = views_field_default_views_data($field_storage);
$data = field_views_field_default_views_data($field_storage);
$entity_manager = \Drupal::entityManager();
$table_mapping = $entity_manager->getStorage($field_storage->getTargetEntityTypeId())->getTableMapping();
foreach ($data as $table_name => $table_data) {
......
This diff is collapsed.
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\views\Plugin\views\argument\FieldList.
* Definition of views_handler_argument_field_list.
*/
namespace Drupal\views\Plugin\views\argument;
namespace Drupal\field\Plugin\views\argument;
use Drupal\Component\Utility\String;
use Drupal\Core\Field\AllowedTagsXssTrait;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\views\Plugin\views\argument\ListString.
* Definition of Drupal\field\Plugin\views\argument\ListString.
*/
namespace Drupal\views\Plugin\views\argument;
namespace Drupal\field\Plugin\views\argument;
use Drupal\Component\Utility\String as UtilityString;
use Drupal\Core\Field\AllowedTagsXssTrait;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\views\Plugin\views\field\Field.
* Definition of Drupal\field\Plugin\views\field\Field.
*/
namespace Drupal\views\Plugin\views\field;
namespace Drupal\field\Plugin\views\field;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Utility\Xss;
......
......@@ -2,10 +2,12 @@
/**
* @file
* Contains \Drupal\views\Plugin\views\filter\FieldList.
* Definition of Drupal\field\Plugin\views\filter\FieldList.
*/
namespace Drupal\views\Plugin\views\filter;
namespace Drupal\field\Plugin\views\filter;
use Drupal\views\Plugin\views\filter\ManyToOne;
/**
* Filter handler which uses list-fields as options.
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\views\Plugin\views\relationship\EntityReverse.
* Definition of Drupal\field\Plugin\views\relationship\EntityReverse.
*/
namespace Drupal\views\Plugin\views\relationship;
namespace Drupal\field\Plugin\views\relationship;
use Drupal\views\Plugin\ViewsHandlerManager;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
......
......@@ -13,10 +13,10 @@
* Views integration for file fields. Adds a file relationship to the default
* field data.
*
* @see views_field_default_views_data()
* @see field_views_field_default_views_data()
*/
function file_field_views_data(FieldStorageConfigInterface $field_storage) {
$data = views_field_default_views_data($field_storage);
$data = field_views_field_default_views_data($field_storage);
foreach ($data as $table_name => $table_data) {
// Add the relationship only on the fid field.
$data[$table_name][$field_storage->getName() . '_target_id']['relationship'] = array(
......@@ -45,7 +45,7 @@ function file_field_views_data_views_data_alter(array &$data, FieldStorageConfig
/** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
$table_mapping = $entity_manager->getStorage($entity_type_id)->getTableMapping();
list($label) = views_entity_field_label($entity_type_id, $field_name);
list($label) = field_views_field_label($entity_type_id, $field_name);
$data['file_managed'][$pseudo_field_name]['relationship'] = array(
'title' => t('@entity using @field', array('@entity' => $entity_type->getLabel(), '@field' => $label)),
......
......@@ -13,10 +13,10 @@
* Views integration for image fields. Adds an image relationship to the default
* field data.
*
* @see views_field_default_views_data()
* @see field_views_field_default_views_data()
*/
function image_field_views_data(FieldStorageConfigInterface $field_storage) {
$data = views_field_default_views_data($field_storage);
$data = field_views_field_default_views_data($field_storage);
foreach ($data as $table_name => $table_data) {
// Add the relationship only on the target_id field.
$data[$table_name][$field_storage->getName() . '_target_id']['relationship'] = array(
......@@ -44,7 +44,7 @@ function image_field_views_data_views_data_alter(array &$data, FieldStorageConfi
/** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
$table_mapping = $entity_manager->getStorage($entity_type_id)->getTableMapping();
list($label) = views_entity_field_label($entity_type_id, $field_name);
list($label) = field_views_field_label($entity_type_id, $field_name);
$data['file_managed'][$pseudo_field_name]['relationship'] = array(
'title' => t('@entity using @field', array('@entity' => $entity_type->getLabel(), '@field' => $label)),
......
......@@ -57,10 +57,10 @@ function taxonomy_views_data_alter(&$data) {
* Views integration for taxonomy_term_reference fields. Adds a term relationship to the default
* field data.
*
* @see views_field_default_views_data()
* @see field_views_field_default_views_data()
*/
function taxonomy_field_views_data(FieldStorageConfigInterface $field_storage) {
$data = views_field_default_views_data($field_storage);
$data = field_views_field_default_views_data($field_storage);
foreach ($data as $table_name => $table_data) {
foreach ($table_data as $field_name => $field_data) {
if (isset($field_data['filter']) && $field_name != 'delta') {
......@@ -98,7 +98,7 @@ function taxonomy_field_views_data_views_data_alter(array &$data, FieldStorageCo
/** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
$table_mapping = $entity_manager->getStorage($entity_type_id)->getTableMapping();
list($label) = views_entity_field_label($entity_type_id, $field_name);
list($label) = field_views_field_label($entity_type_id, $field_name);
$data['taxonomy_term_data'][$pseudo_field_name]['relationship'] = array(
'title' => t('@entity using @field', array('@entity' => $entity_type->getLabel(), '@field' => $label)),
......
......@@ -445,7 +445,7 @@ function hook_views_data_alter(array &$data) {
* @see hook_field_views_data_views_data_alter()
*/
function hook_field_views_data(\Drupal\field\FieldStorageConfigInterface $field_storage) {
$data = views_field_default_views_data($field_storage);
$data = field_views_field_default_views_data($field_storage);
foreach ($data as $table_name => $table_data) {
// Add the relationship only on the target_id field.
$data[$table_name][$field_storage->getName() . '_target_id']['relationship'] = array(
......@@ -484,7 +484,7 @@ function hook_field_views_data_alter(array &$data, \Drupal\field\FieldStorageCon
$pseudo_field_name = 'reverse_' . $field_name . '_' . $entity_type_id;
$table_mapping = \Drupal::entityManager()->getStorage($entity_type_id)->getTableMapping();
list($label) = views_entity_field_label($entity_type_id, $field_name);
list($label) = field_views_field_label($entity_type_id, $field_name);
$data['file_managed'][$pseudo_field_name]['relationship'] = array(
'title' => t('@entity using @field', array('@entity' => $entity_type->getLabel(), '@field' => $label)),
......@@ -539,7 +539,7 @@ function hook_field_views_data_views_data_alter(array &$data, \Drupal\field\Fiel
$entity_type_id = $field->entity_type;
$entity_type = \Drupal::entityManager()->getDefinition($entity_type_id);
$pseudo_field_name = 'reverse_' . $field_name . '_' . $entity_type_id;
list($label) = views_entity_field_label($entity_type_id, $field_name);
list($label) = field_views_field_label($entity_type_id, $field_name);
$table_mapping = \Drupal::entityManager()->getStorage($entity_type_id)->getTableMapping();
// Views data for this field is in $data[$data_key].
......
This diff is collapsed.
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