From 6c175ddd4008b2f4a9cd7db95d8b1ecc6134067e Mon Sep 17 00:00:00 2001
From: Paul Mitchum <Mile23@116231.no-reply.drupal.org>
Date: Tue, 21 Aug 2012 23:31:25 -0700
Subject: [PATCH] 1743490

---
 entityreference.feeds.inc                                      |  7 ++++---
 entityreference.module                                         | 10 ++++++----
 .../behavior/EntityReferenceFieldBehaviorExample.class.php     |  8 ++++----
 .../behavior/EntityReferenceInstanceBehaviorExample.class.php  |  8 ++++----
 .../selection/EntityReference_SelectionHandler_Views.class.php |  4 ++--
 plugins/selection/abstract.inc                                 |  1 +
 tests/entityreference.handlers.test                            |  5 +++++
 views/entityreference_plugin_display.inc                       |  6 +++---
 views/entityreference_plugin_row_fields.inc                    |  2 +-
 9 files changed, 30 insertions(+), 21 deletions(-)

diff --git a/entityreference.feeds.inc b/entityreference.feeds.inc
index 093fa5f..d9b5c0c 100644
--- a/entityreference.feeds.inc
+++ b/entityreference.feeds.inc
@@ -12,8 +12,8 @@
  */
 function entityreference_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) {
 
-  foreach (field_info_instances($entity_type, $bundle_name) as
-           $name => $instance) {
+  foreach (field_info_instances($entity_type, $bundle_name)
+      as $name => $instance) {
     $info = field_info_field($name);
     if ($info['type'] == 'entityreference') {
       $targets[$name] = array(
@@ -58,7 +58,8 @@ function entityreference_feeds_set_target($source, $entity, $target, $value, $ma
   // Assume that the passed in value could really be any number of values.
   if (is_array($value)) {
     $values = $value;
-  } else {
+  }
+  else {
     $values = array($value);
   }
 
diff --git a/entityreference.module b/entityreference.module
index 425c8aa..e081295 100644
--- a/entityreference.module
+++ b/entityreference.module
@@ -15,7 +15,7 @@ function entityreference_ctools_plugin_directory($module, $plugin) {
 function entityreference_init() {
   // Include feeds.module integration.
   if (module_exists('feeds')) {
-    module_load_include('inc','entityreference','entityreference.feeds');
+    module_load_include('inc', 'entityreference', 'entityreference.feeds');
   }
 }
 
@@ -46,7 +46,7 @@ function entityreference_behavior_plugin_process(&$plugin, $info) {
 }
 
 /**
- * Implementation of hook_field_info().
+ * Implements hook_field_info().
  */
 function entityreference_field_info() {
   $field_info['entityreference'] = array(
@@ -735,7 +735,8 @@ function _entityreference_autocomplete_validate($element, &$form_state, $form) {
     // Take "label (entity id)', match the id from parenthesis.
     if (preg_match("/.+\((\d+)\)/", $element['#value'], $matches)) {
       $value = $matches[1];
-    } else {
+    }
+    else {
       // Try to get a match from the input string when the user didn't use the
       // autocomplete but filled in a value manually.
       $field = field_info_field($element['#field_name']);
@@ -759,7 +760,8 @@ function _entityreference_autocomplete_tags_validate($element, &$form_state, $fo
         $value[] = array(
           'target_id' => $matches[1],
         );
-      } else {
+      }
+      else {
         // Try to get a match from the input string when the user didn't use the
         // autocomplete but filled in a value manually.
         $field = field_info_field($element['#field_name']);
diff --git a/examples/entityreference_behavior_example/plugins/behavior/EntityReferenceFieldBehaviorExample.class.php b/examples/entityreference_behavior_example/plugins/behavior/EntityReferenceFieldBehaviorExample.class.php
index 4161043..6d2a7a8 100644
--- a/examples/entityreference_behavior_example/plugins/behavior/EntityReferenceFieldBehaviorExample.class.php
+++ b/examples/entityreference_behavior_example/plugins/behavior/EntityReferenceFieldBehaviorExample.class.php
@@ -3,19 +3,19 @@
 class EntityReferenceFieldBehaviorExample extends EntityReference_BehaviorHandler_Abstract {
 
   public function load($entity_type, $entities, $field, $instances, $langcode, &$items) {
-    drupal_set_message('Do something on load!');
+    drupal_set_message(t('Do something on load!'));
   }
 
   public function insert($entity_type, $entity, $field, $instance, $langcode, &$items) {
-    drupal_set_message('Do something on insert!');
+    drupal_set_message(t('Do something on insert!'));
   }
 
   public function update($entity_type, $entity, $field, $instance, $langcode, &$items) {
-    drupal_set_message('Do something on update!');
+    drupal_set_message(t('Do something on update!'));
   }
 
   public function delete($entity_type, $entity, $field, $instance, $langcode, &$items) {
-    drupal_set_message('Do something on delete!');
+    drupal_set_message(t('Do something on delete!'));
   }
 
   /**
diff --git a/examples/entityreference_behavior_example/plugins/behavior/EntityReferenceInstanceBehaviorExample.class.php b/examples/entityreference_behavior_example/plugins/behavior/EntityReferenceInstanceBehaviorExample.class.php
index 6e6f329..c09ab43 100644
--- a/examples/entityreference_behavior_example/plugins/behavior/EntityReferenceInstanceBehaviorExample.class.php
+++ b/examples/entityreference_behavior_example/plugins/behavior/EntityReferenceInstanceBehaviorExample.class.php
@@ -3,19 +3,19 @@
 class EntityReferenceInstanceBehaviorExample extends EntityReference_BehaviorHandler_Abstract {
 
   public function load($entity_type, $entities, $field, $instances, $langcode, &$items) {
-    drupal_set_message('Do something on load, on the instance level!');
+    drupal_set_message(t('Do something on load, on the instance level!'));
   }
 
   public function insert($entity_type, $entity, $field, $instance, $langcode, &$items) {
-    drupal_set_message('Do something on insert, on the instance level!');
+    drupal_set_message(t('Do something on insert, on the instance level!'));
   }
 
   public function update($entity_type, $entity, $field, $instance, $langcode, &$items) {
-    drupal_set_message('Do something on update, on the instance level!');
+    drupal_set_message(t('Do something on update, on the instance level!'));
   }
 
   public function delete($entity_type, $entity, $field, $instance, $langcode, &$items) {
-    drupal_set_message('Do something on delete, on the instance level!');
+    drupal_set_message(t('Do something on delete, on the instance level!'));
   }
 
   /**
diff --git a/plugins/selection/EntityReference_SelectionHandler_Views.class.php b/plugins/selection/EntityReference_SelectionHandler_Views.class.php
index 92fa7a1..a370f59 100644
--- a/plugins/selection/EntityReference_SelectionHandler_Views.class.php
+++ b/plugins/selection/EntityReference_SelectionHandler_Views.class.php
@@ -30,7 +30,7 @@ class EntityReference_SelectionHandler_Views implements EntityReference_Selectio
     foreach ($displays as $data) {
       list($view, $display_id) = $data;
       if ($view->base_table == $entity_info['base table']) {
-        $options[$view->name . ':' . $display_id] = $view->name .' - ' . $view->display[$display_id]->display_title;
+        $options[$view->name . ':' . $display_id] = $view->name . ' - ' . $view->display[$display_id]->display_title;
       }
     }
 
@@ -42,7 +42,7 @@ class EntityReference_SelectionHandler_Views implements EntityReference_Selectio
       $form['view']['#element_validate'] = array('entityreference_view_settings_validate');
 
       $options = array('' => '<' . t('none') . '>') + $options;
-      $default = !empty($view_settings['view_name']) ? $view_settings['view_name'] . ':' .$view_settings['display_name'] : '';
+      $default = !empty($view_settings['view_name']) ? $view_settings['view_name'] . ':' . $view_settings['display_name'] : '';
       $form['view']['view_and_display'] = array(
         '#type' => 'select',
         '#title' => t('View used to select the entities'),
diff --git a/plugins/selection/abstract.inc b/plugins/selection/abstract.inc
index fc5117c..1d2ea0d 100644
--- a/plugins/selection/abstract.inc
+++ b/plugins/selection/abstract.inc
@@ -1,6 +1,7 @@
 <?php
 
 /**
+ * @file
  * Abstraction of the selection logic of an entity reference field.
  *
  * Implementations that wish to provide an implementation of this should
diff --git a/tests/entityreference.handlers.test b/tests/entityreference.handlers.test
index 598cb8f..6c2ceca 100644
--- a/tests/entityreference.handlers.test
+++ b/tests/entityreference.handlers.test
@@ -1,6 +1,11 @@
 <?php
 
 /**
+ * @file
+ * Contains EntityReferenceHandlersTestCase
+ */
+
+/**
  * Test for Entity Reference handlers.
  */
 class EntityReferenceHandlersTestCase extends DrupalWebTestCase {
diff --git a/views/entityreference_plugin_display.inc b/views/entityreference_plugin_display.inc
index 1fc6450..7a1b768 100644
--- a/views/entityreference_plugin_display.inc
+++ b/views/entityreference_plugin_display.inc
@@ -57,8 +57,8 @@ class entityreference_plugin_display extends views_plugin_display {
     // Make sure the id field is included in the results, and save its alias
     // so that references_plugin_style can retrieve it.
     $this->id_field_alias = $id_field = $this->view->query->add_field($this->view->base_table, $this->view->base_field);
-    if (strpos($id_field, '.') === false) {
-      $id_field = $this->view->base_table .'.'.$this->id_field_alias;
+    if (strpos($id_field, '.') === FALSE) {
+      $id_field = $this->view->base_table . '.' . $this->id_field_alias;
     }
 
     // Restrict the autocomplete options based on what's been typed already.
@@ -94,7 +94,7 @@ class entityreference_plugin_display extends views_plugin_display {
   }
 
   /**
-   * Extend the default validation. 
+   * Extend the default validation.
    */
   function validate() {
     $errors = parent::validate();
diff --git a/views/entityreference_plugin_row_fields.inc b/views/entityreference_plugin_row_fields.inc
index 400603f..dc3c4b6 100644
--- a/views/entityreference_plugin_row_fields.inc
+++ b/views/entityreference_plugin_row_fields.inc
@@ -21,7 +21,7 @@ class entityreference_plugin_row_fields extends views_plugin_row_fields {
     parent::options_form($form, $form_state);
 
     // Expand the description of the 'Inline field' checkboxes.
-    $form['inline']['#description'] .= '<br>' . t("<strong>Note:</strong> In 'Entity Reference' displays, all fields will be displayed inline unless an explicit selection of inline fields is made here." );
+    $form['inline']['#description'] .= '<br />' . t("<strong>Note:</strong> In 'Entity Reference' displays, all fields will be displayed inline unless an explicit selection of inline fields is made here." );
   }
 
   function pre_render($row) {
-- 
1.7.12

