commit 169e1e3ac829fcb516672ee23566a91e0e7d2fdd Author: Yves Chedemois Date: Mon Aug 5 21:46:17 2013 +0200 fix merge error diff --git a/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php b/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php index 3fce5bf..489a908 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php +++ b/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php @@ -356,7 +356,7 @@ protected function saveNew() { $instance_controller = \Drupal::entityManager()->getStorageController($this->entityType); // Ensure the field instance is unique within the bundle. - if ($prior_instance = $instance_controller->load($this->id)) { + if ($prior_instance = $instance_controller->load($this->id())) { throw new FieldException(format_string('Attempt to create an instance of field %name on bundle @bundle that already has an instance of that field.', array('%name' => $this->field->name, '@bundle' => $this->bundle))); } commit d5609e5bc28af80fc4d27634cded440afeaf4ae6 Author: Yves Chedemois Date: Mon Aug 5 22:12:26 2013 +0200 more code style diff --git a/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php b/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php index 1a5859c..4b6d001 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php +++ b/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php @@ -421,7 +421,7 @@ public function delete() { $instance_ids = array(); foreach ($this->getBundles() as $entity_type => $bundles) { foreach ($bundles as $bundle) { - $instance_ids[] = "$entity_type.$bundle.$this->name"; + $instance_ids[] = "$entity_type.$bundle.{$this->name}"; } } foreach ($instance_controller->loadMultiple($instance_ids) as $instance) { diff --git a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php index 400390b..a0e8f6e 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php +++ b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php @@ -8,8 +8,8 @@ namespace Drupal\field\Plugin\views\field; use Drupal\Core\Entity\DatabaseStorageController; -use Drupal\Core\Language\Language; use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Language\Language; use Drupal\field\Plugin\Type\Formatter\FormatterPluginManager; use Drupal\views\ViewExecutable; use Drupal\views\Plugin\views\display\DisplayPluginBase; diff --git a/core/modules/file/file.views.inc b/core/modules/file/file.views.inc index cfc7fa3..7632e49 100644 --- a/core/modules/file/file.views.inc +++ b/core/modules/file/file.views.inc @@ -6,7 +6,9 @@ * * @ingroup views_module_handlers */ + use Drupal\Core\Entity\DatabaseStorageController; +use Drupal\field\FieldInterface; /** * Implements hook_views_data(). @@ -461,7 +463,7 @@ function file_views_data() { * * @see field_views_field_default_views_data() */ -function file_field_views_data($field, $sql_entity_types) { +function file_field_views_data(FieldInterface $field, array $sql_entity_types) { $data = field_views_field_default_views_data($field, $sql_entity_types); foreach ($data as $table_name => $table_data) { // Add the relationship only on the fid field. @@ -482,7 +484,7 @@ function file_field_views_data($field, $sql_entity_types) { * * Views integration to provide reverse relationships on file fields. */ -function file_field_views_data_views_data_alter(&$data, $field, $sql_entity_types) { +function file_field_views_data_views_data_alter(array &$data, FieldInterface $field, array $sql_entity_types) { foreach ($sql_entity_types as $entity_type) { $entity_info = entity_get_info($entity_type); $pseudo_field_name = 'reverse_' . $field['field_name'] . '_' . $entity_type; diff --git a/core/modules/image/image.views.inc b/core/modules/image/image.views.inc index cfb4d63..b97ca79 100644 --- a/core/modules/image/image.views.inc +++ b/core/modules/image/image.views.inc @@ -6,7 +6,9 @@ * * @ingroup views_module_handlers */ + use Drupal\Core\Entity\DatabaseStorageController; +use Drupal\field\FieldInterface; /** * Implements hook_field_views_data(). @@ -16,7 +18,7 @@ * * @see field_views_field_default_views_data() */ -function image_field_views_data($field, $sql_entity_types) { +function image_field_views_data(FieldInterface $field, array $sql_entity_types) { $data = field_views_field_default_views_data($field, $sql_entity_types); foreach ($data as $table_name => $table_data) { // Add the relationship only on the target_id field. @@ -36,7 +38,7 @@ function image_field_views_data($field, $sql_entity_types) { * * Views integration to provide reverse relationships on image fields. */ -function image_field_views_data_views_data_alter(&$data, $field, $sql_entity_types) { +function image_field_views_data_views_data_alter(array &$data, FieldInterface $field, array $sql_entity_types) { foreach ($sql_entity_types as $entity_type) { $entity_info = entity_get_info($entity_type); $pseudo_field_name = 'reverse_' . $field['field_name'] . '_' . $entity_type; diff --git a/core/modules/taxonomy/taxonomy.pages.inc b/core/modules/taxonomy/taxonomy.pages.inc index 06e5af8..a8b5771 100644 --- a/core/modules/taxonomy/taxonomy.pages.inc +++ b/core/modules/taxonomy/taxonomy.pages.inc @@ -98,9 +98,9 @@ function taxonomy_term_feed(Term $term) { * }; * @endcode * - * @param $entity_type + * @param string $entity_type * The entity_type. - * @param $field_name + * @param string $field_name * The name of the term reference field. * * @see taxonomy_menu() diff --git a/core/modules/taxonomy/taxonomy.views.inc b/core/modules/taxonomy/taxonomy.views.inc index 738bfdd..25c0c40 100644 --- a/core/modules/taxonomy/taxonomy.views.inc +++ b/core/modules/taxonomy/taxonomy.views.inc @@ -6,7 +6,9 @@ * * @ingroup views_module_handlers */ + use Drupal\Core\Entity\DatabaseStorageController; +use Drupal\field\FieldInterface; /** * Implements hook_views_data(). @@ -336,7 +338,7 @@ function taxonomy_views_data_alter(&$data) { * * @see field_views_field_default_views_data() */ -function taxonomy_field_views_data($field, $sql_entity_types) { +function taxonomy_field_views_data(FieldInterface $field, array $sql_entity_types) { $data = field_views_field_default_views_data($field, $sql_entity_types); foreach ($data as $table_name => $table_data) { foreach ($table_data as $field_name => $field_data) { @@ -364,7 +366,7 @@ function taxonomy_field_views_data($field, $sql_entity_types) { * * Views integration to provide reverse relationships on term references. */ -function taxonomy_field_views_data_views_data_alter(&$data, $field, $sql_entity_types) { +function taxonomy_field_views_data_views_data_alter(array &$data, FieldInterface $field, array $sql_entity_types) { foreach ($sql_entity_types as $entity_type) { $entity_info = entity_get_info($entity_type); $pseudo_field_name = 'reverse_' . $field['field_name'] . '_' . $entity_type;