diff --git a/core/modules/entity_reference/entity_reference.install b/core/modules/entity_reference/entity_reference.install index 17030ef..1de70ca 100644 --- a/core/modules/entity_reference/entity_reference.install +++ b/core/modules/entity_reference/entity_reference.install @@ -2,7 +2,7 @@ /** * @file - * Install, update and uninstall functions for the Entity reference + * Install, update and uninstall functions for the Entity Reference * module. */ diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module index 4578dc8..fad12f2 100644 --- a/core/modules/entity_reference/entity_reference.module +++ b/core/modules/entity_reference/entity_reference.module @@ -201,7 +201,7 @@ function entity_reference_field_settings_form($field, $instance, $has_data) { /** * Implements hook_field_update_field(). * - * Reset the instance handler settings, when the target-type is changed. + * Reset the instance handler settings, when the target type is changed. */ function entity_reference_field_update_field($field, $prior_field, $has_data) { if ($field['type'] != 'entity_reference') { @@ -425,7 +425,7 @@ function entity_reference_query_entity_reference_alter(AlterableInterface $query * @param string $type * The widget type (i.e. 'single' or 'tags'). * @param string $field_name - * The name of the entity-reference field. + * The name of the entity reference field. * @param string $entity_type * The entity type. * @param string $bundle_name @@ -455,13 +455,13 @@ function entity_reference_autocomplete_access_callback($type, $field_name, $enti * @param string $type * The widget type (i.e. 'single' or 'tags'). * @param string $field_name - * The name of the entity-reference field. + * The name of the entity reference field. * @param string $entity_type * The entity type. * @param string $bundle_name * The bundle name. * @param string $entity_id - * (optional) The entity ID the entity-reference field is attached to. + * (optional) The entity ID the entity reference field is attached to. * Defaults to ''. * * @return \Symfony\Component\HttpFoundation\JsonResponse @@ -493,7 +493,7 @@ function entity_reference_autocomplete_callback($type, $field_name, $entity_type * @param string $entity_type * The entity type. * @param string $entity_id - * (optional) The entity ID the entity-reference field is attached to. + * (optional) The entity ID the entity reference field is attached to. * Defaults to ''. * @param string $string * The label of the entity to query by. diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceBundle.php b/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceBundle.php index 434937d..e490441 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceBundle.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceBundle.php @@ -11,7 +11,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; /** - * Entity reference dependency injection container. + * Entity Reference dependency injection container. */ class EntityReferenceBundle extends Bundle { diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Derivative/SelectionBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Derivative/SelectionBase.php index f8f784d..9e191bf 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Derivative/SelectionBase.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Derivative/SelectionBase.php @@ -10,7 +10,7 @@ use Drupal\Component\Plugin\Derivative\DerivativeInterface; /** - * Base class for selection plugins provided by Entity reference. + * Base class for selection plugins provided by Entity Reference. */ class SelectionBase implements DerivativeInterface { diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionInterface.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionInterface.php index 7e41792..da9b699 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionInterface.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionInterface.php @@ -10,7 +10,7 @@ use Drupal\Core\Database\Query\SelectInterface; /** - * Interface definition for Entity reference selection plugins. + * Interface definition for Entity Reference selection plugins. * * This interface details the methods that most plugin implementations will want * to override. See Drupal\field\Plugin\Type\Selection\SelectionBaseInterface @@ -23,8 +23,8 @@ * Returns a list of referencable entities. * * @return array - * An array of referencable entities, which keys are entity ids and - * values (safe HTML) labels to be displayed to the user. + * An array of referencable entities. Keys are entity ids and + * values are (safe HTML) labels to be displayed to the user. */ public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0); diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php index a7a9006..205df06 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php @@ -279,7 +279,7 @@ public function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') { $query->addTag($this->field['settings']['target_type'] . '_access'); // Add the Selection handler for - // entity_reference_query_entity_reference_alter() + // entity_reference_query_entity_reference_alter(). $query->addTag('entity_reference'); $query->addMetaData('field', $this->field); $query->addMetaData('entity_reference_selection_handler', $this); diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceEntityFormatter.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceEntityFormatter.php index a77ded3..bd10076 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceEntityFormatter.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceEntityFormatter.php @@ -14,7 +14,7 @@ use Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase; /** - * Plugin implementation of the 'entity-reference rendered entity' formatter. + * Plugin implementation of the 'entity reference rendered entity' formatter. * * @Plugin( * id = "entity_reference_entity_view", diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceFormatterBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceFormatterBase.php index d730925..b168a42 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceFormatterBase.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceFormatterBase.php @@ -13,7 +13,7 @@ use Drupal\field\Plugin\Type\Formatter\FormatterBase; /** - * Parent plugin for entity-reference formatters. + * Parent plugin for entity reference formatters. */ abstract class EntityReferenceFormatterBase extends FormatterBase { @@ -52,18 +52,17 @@ public function prepareView(array $entities, $langcode, array &$items) { // We need to load the revisions one by-one. foreach ($revision_ids as $revision_id) { $entity = entity_revision_load($target_type, $revision_id); - // Use the revision-ID in the key. + // Use the revision ID in the key. $identifier = $entity->id() . ':' . $revision_id; $target_entities[$identifier] = $entity; } } - // Iterate through the fieldable entities again to attach the loaded - // data. + // Iterate through the fieldable entities again to attach the loaded data. foreach ($entities as $id => $entity) { $rekey = FALSE; foreach ($items[$id] as $delta => $item) { - // If we have a revision-ID, the key uses it as-well. + // If we have a revision ID, the key uses it as well. $identifier = !empty($item['revision_id']) ? $item['target_id'] . ':' . $item['revision_id'] : $item['target_id']; if ($item['target_id'] != 'auto_create') { if (!isset($target_entities[$identifier])) { diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceIdFormatter.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceIdFormatter.php index 263a24e..1703d3e 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceIdFormatter.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceIdFormatter.php @@ -13,7 +13,7 @@ use Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase; /** - * Plugin implementation of the 'entity-reference ID' formatter. + * Plugin implementation of the 'entity reference ID' formatter. * * @Plugin( * id = "entity_reference_entity_id", diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceLabelFormatter.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceLabelFormatter.php index 3b5d611..abd4007 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceLabelFormatter.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceLabelFormatter.php @@ -13,7 +13,7 @@ use Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase; /** - * Plugin implementation of the 'entity-reference label' formatter. + * Plugin implementation of the 'entity reference label' formatter. * * @Plugin( * id = "entity_reference_label", diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php index 276b19b..ae41855 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php @@ -12,7 +12,7 @@ use Drupal\field\Plugin\Type\Widget\WidgetBase; /** - * Parent plugin for entity-reference autocomplete widgets. + * Parent plugin for entity reference autocomplete widgets. */ abstract class AutocompleteWidgetBase extends WidgetBase { @@ -101,7 +101,7 @@ protected function getLabels(array $items) { $entity_ids = array(); $entity_labels = array(); - // Build an array of entities ID. + // Build an array of entity IDs. foreach ($items as $item) { $entity_ids[] = $item['target_id']; } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php index 9327aa5..edca783 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php @@ -134,15 +134,15 @@ public function query() { $value = '%' . $value; } - // Multiple search fields are OR'd together + // Multiple search fields are OR'd together. $conditions = db_or(); - // Build the condition using the selected search fields + // Build the condition using the selected search fields. foreach ($style_options['options']['search_fields'] as $field_alias) { if (!empty($field_alias)) { - // Get the table and field names for the checked field + // Get the table and field names for the checked field. $field = $this->view->query->fields[$this->view->field[$field_alias]->field_alias]; - // Add an OR condition for the field + // Add an OR condition for the field. $conditions->condition($field['table'] . '.' . $field['field'], $value, 'LIKE'); } } @@ -170,7 +170,6 @@ public function validate() { } else { // Verify that the search fields used actually exist. - //$fields = array_keys($this->view->get_items('field')); $fields = array_keys($this->handlers['field']); foreach ($style['options']['search_fields'] as $field_alias => $enabled) { if ($enabled && !in_array($field_alias, $fields)) { diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/style/EntityReference.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/style/EntityReference.php index c15c2ae..1ab46ac 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/style/EntityReference.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/style/EntityReference.php @@ -80,7 +80,8 @@ public function render() { // Group the rows according to the grouping field, if specified. $sets = $this->render_grouping($this->view->result, $this->options['grouping']); - // Grab the alias of the 'id' field added by entity_reference_plugin_display. + // Grab the alias of the 'id' field added by + // entity_reference_plugin_display. $id_field_alias = $this->view->storage->get('base_field'); // @todo We don't display grouping info for now. Could be useful for select @@ -89,7 +90,7 @@ public function render() { $this->view->row_index = 0; foreach ($sets as $records) { foreach ($records as $values) { - // Sanitize html, remove line breaks and extra whitespace. + // Sanitize HTML, remove line breaks and extra whitespace. $output = $this->row_plugin->render($values); $output = drupal_render($output); $results[$values->{$id_field_alias}] = filter_xss_admin(preg_replace('/\s\s+/', ' ', str_replace("\n", '', $output))); diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAdminTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAdminTest.php index d4e31f7..bbfd49a 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAdminTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAdminTest.php @@ -10,12 +10,12 @@ use Drupal\simpletest\WebTestBase; /** - * Tests the Entity reference Admin UI. + * Tests the Entity Reference Admin UI. */ class EntityReferenceAdminTest extends WebTestBase { public static function getInfo() { return array( - 'name' => 'Entity reference UI', + 'name' => 'Entity Reference UI', 'description' => 'Tests for the administrative UI.', 'group' => 'Entity Reference', ); diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutoCreateTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutoCreateTest.php index 821ac44..d7b2d84 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutoCreateTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutoCreateTest.php @@ -10,13 +10,13 @@ use Drupal\simpletest\WebTestBase; /** - * Tests the Entity reference auto-creation feature. + * Tests the Entity Reference auto-creation feature. */ class EntityReferenceAutoCreateTest extends WebTestBase { public static function getInfo() { return array( - 'name' => 'Entity reference auto-create', + 'name' => 'Entity Reference auto-create', 'description' => 'Tests creating new entity (e.g. taxonomy-term) from an autocomplete widget.', 'group' => 'Entity Reference', ); @@ -27,7 +27,7 @@ public static function getInfo() { function setUp() { parent::setUp(); - // Create a "referencing" and "referenced" node types. + // Create "referencing" and "referenced" node types. $referencing = $this->drupalCreateContentType(); $this->referencing_type = $referencing->type; diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutocompleteTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutocompleteTest.php index 968f9bb..3d94c04 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutocompleteTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutocompleteTest.php @@ -86,15 +86,15 @@ function testTermAutocompletion() { $path_prefix = 'entity_reference/autocomplete/single/' . $this->field_name . '/node/article/NULL'; // Try to autocomplete a term name that matches both terms. - // We should get both term in a json encoded string. + // We should get both terms in a JSON encoded string. $input = '10/'; $result = $this->drupalGet($path_prefix, array('query' => array('q' => $input))); $data = drupal_json_decode($result); $this->assertEqual(strip_tags($data[$first_term->name. ' (1)']), check_plain($first_term->name), 'Autocomplete returned the first matching term'); $this->assertEqual(strip_tags($data[$second_term->name. ' (2)']), check_plain($second_term->name), 'Autocomplete returned the second matching term'); - // Try to autocomplete a term name that matches first term. - // We should only get the first term in a json encoded string. + // Try to autocomplete a term name that matches the first term. + // We should only get the first term in a JSON encoded string. $input = '10/16'; $this->drupalGet($path_prefix, array('query' => array('q' => $input))); $target = array($first_term->name . ' (1)' => '