From abe722f0b8f93e32d5a54bc974801bb831a546a1 Mon Sep 17 00:00:00 2001
From: Angie Byron <webchick@24967.no-reply.drupal.org>
Date: Wed, 3 Jun 2009 02:41:07 +0000
Subject: [PATCH] #453726 by yched: Remove unnecessary &s next to object
 parameters in field API.

---
 modules/field/field.api.php      |  6 +++---
 modules/field/field.attach.inc   | 30 +++++++++++++++---------------
 modules/field/field.autoload.inc | 20 ++++++++++----------
 modules/field/field.default.inc  |  4 ++--
 4 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/modules/field/field.api.php b/modules/field/field.api.php
index b73e4707f2b4..f887b8a323a1 100644
--- a/modules/field/field.api.php
+++ b/modules/field/field.api.php
@@ -494,7 +494,7 @@ function hook_field_attach_form($obj_type, $object, &$form, &$form_state) {
  *   set as an empty array.
  *   - Loaded field names are set as keys in $skip_fields.
  */
-function hook_field_attach_pre_load($obj_type, &$objects, $age, &$skip_fields) {
+function hook_field_attach_pre_load($obj_type, $objects, $age, &$skip_fields) {
 }
 
 /**
@@ -512,7 +512,7 @@ function hook_field_attach_pre_load($obj_type, &$objects, $age, &$skip_fields) {
  *
  * See field_attach_load() for details and arguments.
  */
-function hook_field_attach_load($obj_type, &$objects, $age) {
+function hook_field_attach_load($obj_type, $objects, $age) {
 }
 
 /**
@@ -688,7 +688,7 @@ function hook_field_attach_delete_bundle($bundle, $instances) {
  *   Loaded field values are added to $objects. Fields with no values should be
  *   set as an empty array.
  */
-function hook_field_storage_load($obj_type, &$objects, $age, $skip_fields) {
+function hook_field_storage_load($obj_type, $objects, $age, $skip_fields) {
 }
 
 /**
diff --git a/modules/field/field.attach.inc b/modules/field/field.attach.inc
index c0b1ac8795eb..7d100e6571fc 100644
--- a/modules/field/field.attach.inc
+++ b/modules/field/field.attach.inc
@@ -155,7 +155,7 @@ function __construct($errors) {
  *   - TRUE: use the default field implementation of the field hook.
  *   - FALSE: use the field module's implementation of the field hook.
  */
-function _field_invoke($op, $obj_type, &$object, &$a = NULL, &$b = NULL, $default = FALSE) {
+function _field_invoke($op, $obj_type, $object, &$a = NULL, &$b = NULL, $default = FALSE) {
   list(, , $bundle) = field_attach_extract_ids($obj_type, $object);
   $instances = field_info_instances($bundle);
 
@@ -206,7 +206,7 @@ function _field_invoke($op, $obj_type, &$object, &$a = NULL, &$b = NULL, $defaul
  * @return
  *   An array of returned values keyed by object id.
  */
-function _field_invoke_multiple($op, $obj_type, &$objects, &$a = NULL, &$b = NULL, $default = FALSE) {
+function _field_invoke_multiple($op, $obj_type, $objects, &$a = NULL, &$b = NULL, $default = FALSE) {
   $fields = array();
   $grouped_instances = array();
   $grouped_objects = array();
@@ -226,7 +226,7 @@ function _field_invoke_multiple($op, $obj_type, &$objects, &$a = NULL, &$b = NUL
         $fields[$field_name] = field_info_field($field_name);
       }
       $grouped_instances[$field_name][$id] = $instance;
-      $grouped_objects[$field_name][$id] = &$objects[$id];
+      $grouped_objects[$field_name][$id] = $objects[$id];
       $grouped_items[$field_name][$id] = isset($object->$field_name) ? $object->$field_name : array();
     }
     $return[$id] = array();
@@ -267,14 +267,14 @@ function _field_invoke_multiple($op, $obj_type, &$objects, &$a = NULL, &$b = NUL
 /**
  * Invoke field.module's version of a field hook.
  */
-function _field_invoke_default($op, $obj_type, &$object, &$a = NULL, &$b = NULL) {
+function _field_invoke_default($op, $obj_type, $object, &$a = NULL, &$b = NULL) {
   return _field_invoke($op, $obj_type, $object, $a, $b, TRUE);
 }
 
 /**
  * Invoke field.module's version of a field hook on multiple objects.
  */
-function _field_invoke_multiple_default($op, $obj_type, &$objects, &$a = NULL, &$b = NULL) {
+function _field_invoke_multiple_default($op, $obj_type, $objects, &$a = NULL, &$b = NULL) {
   return _field_invoke_multiple($op, $obj_type, $objects, $a, $b, TRUE);
 }
 
@@ -440,7 +440,7 @@ function _field_attach_load_revision($obj_type, $objects) {
  * @return
  *   Throws a FieldValidationException if validation errors are found.
  */
-function _field_attach_validate($obj_type, &$object) {
+function _field_attach_validate($obj_type, $object) {
   $errors = array();
   _field_invoke_default('validate', $obj_type, $object, $errors);
   _field_invoke('validate', $obj_type, $object, $errors);
@@ -484,7 +484,7 @@ function _field_attach_validate($obj_type, &$object) {
  * @param $form_state
  *   An associative array containing the current state of the form.
  */
-function _field_attach_form_validate($obj_type, &$object, $form, &$form_state) {
+function _field_attach_form_validate($obj_type, $object, $form, &$form_state) {
   // Extract field values from submitted values.
   _field_invoke_default('extract_form_values', $obj_type, $object, $form, $form_state);
 
@@ -516,7 +516,7 @@ function _field_attach_form_validate($obj_type, &$object, $form, &$form_state) {
  * @param $form_state
  *   An associative array containing the current state of the form.
  */
-function _field_attach_submit($obj_type, &$object, $form, &$form_state) {
+function _field_attach_submit($obj_type, $object, $form, &$form_state) {
   // Extract field values from submitted values.
   _field_invoke_default('extract_form_values', $obj_type, $object, $form, $form_state);
 
@@ -540,7 +540,7 @@ function _field_attach_submit($obj_type, &$object, $form, &$form_state) {
  * @param $object
  *   The object with fields to process.
  */
-function _field_attach_presave($obj_type, &$object) {
+function _field_attach_presave($obj_type, $object) {
   // TODO : to my knowledge, no field module has any use for 'presave' on D6.
   // should we keep this ?
   _field_invoke('presave', $obj_type, $object);
@@ -568,7 +568,7 @@ function _field_attach_presave($obj_type, &$object) {
  *   Default values (if any) will be added to the $object parameter for fields
  *   it leaves unspecified.
  */
-function _field_attach_insert($obj_type, &$object) {
+function _field_attach_insert($obj_type, $object) {
   _field_invoke_default('insert', $obj_type, $object);
   _field_invoke('insert', $obj_type, $object);
 
@@ -597,7 +597,7 @@ function _field_attach_insert($obj_type, &$object) {
  * @param $object
  *   The object with fields to save.
  */
-function _field_attach_update($obj_type, &$object) {
+function _field_attach_update($obj_type, $object) {
   _field_invoke('update', $obj_type, $object);
 
   // Let other modules act on updating the object, accumulating saved
@@ -626,7 +626,7 @@ function _field_attach_update($obj_type, &$object) {
  * @param $object
  *   The object whose field data to delete.
  */
-function _field_attach_delete($obj_type, &$object) {
+function _field_attach_delete($obj_type, $object) {
   _field_invoke('delete', $obj_type, $object);
   module_invoke(variable_get('field_storage_module', 'field_sql_storage'), 'field_storage_delete', $obj_type, $object);
 
@@ -651,7 +651,7 @@ function _field_attach_delete($obj_type, &$object) {
  * @param $object
  *   The object with fields to save.
  */
-function _field_attach_delete_revision($obj_type, &$object) {
+function _field_attach_delete_revision($obj_type, $object) {
   _field_invoke('delete revision', $obj_type, $object);
   module_invoke(variable_get('field_storage_module', 'field_sql_storage'), 'field_storage_delete_revision', $obj_type, $object);
 
@@ -677,7 +677,7 @@ function _field_attach_delete_revision($obj_type, &$object) {
  * @return
  *   A structured content array tree for drupal_render().
  */
-function _field_attach_view($obj_type, &$object, $teaser = FALSE) {
+function _field_attach_view($obj_type, $object, $teaser = FALSE) {
   // Let field modules sanitize their data for output.
   _field_invoke('sanitize', $obj_type, $object);
 
@@ -697,7 +697,7 @@ function _field_attach_view($obj_type, &$object, $teaser = FALSE) {
  *   containing the themed output for the whole field.
  * - Adds the formatted values in the 'view' key of the items.
  */
-function _field_attach_preprocess($obj_type, &$object) {
+function _field_attach_preprocess($obj_type, $object) {
   return _field_invoke_default('preprocess', $obj_type, $object);
 }
 
diff --git a/modules/field/field.autoload.inc b/modules/field/field.autoload.inc
index b7b026d7944d..45d68e77ad0f 100644
--- a/modules/field/field.autoload.inc
+++ b/modules/field/field.autoload.inc
@@ -103,7 +103,7 @@ function field_attach_load_revision($obj_type, $objects) {
  *
  * This function is an autoloader for _field_attach_validate() in modules/field/field.attach.inc.
  */
-function field_attach_validate($obj_type, &$object) {
+function field_attach_validate($obj_type, $object) {
   require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
   return _field_attach_validate($obj_type, $object);
 }
@@ -138,7 +138,7 @@ function field_attach_validate($obj_type, &$object) {
  *
  * This function is an autoloader for _field_attach_form_validate() in modules/field/field.attach.inc.
  */
-function field_attach_form_validate($obj_type, &$object, $form, &$form_state) {
+function field_attach_form_validate($obj_type, $object, $form, &$form_state) {
   require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
   return _field_attach_form_validate($obj_type, $object, $form, $form_state);
 }
@@ -162,7 +162,7 @@ function field_attach_form_validate($obj_type, &$object, $form, &$form_state) {
  *
  * This function is an autoloader for _field_attach_submit() in modules/field/field.attach.inc.
  */
-function field_attach_submit($obj_type, &$object, $form, &$form_state) {
+function field_attach_submit($obj_type, $object, $form, &$form_state) {
   require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
   return _field_attach_submit($obj_type, $object, $form, $form_state);
 }
@@ -180,7 +180,7 @@ function field_attach_submit($obj_type, &$object, $form, &$form_state) {
  *
  * This function is an autoloader for _field_attach_presave() in modules/field/field.attach.inc.
  */
-function field_attach_presave($obj_type, &$object) {
+function field_attach_presave($obj_type, $object) {
   require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
   return _field_attach_presave($obj_type, $object);
 }
@@ -203,7 +203,7 @@ function field_attach_presave($obj_type, &$object) {
  *
  * This function is an autoloader for _field_attach_insert() in modules/field/field.attach.inc.
  */
-function field_attach_insert($obj_type, &$object) {
+function field_attach_insert($obj_type, $object) {
   require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
   return _field_attach_insert($obj_type, $object);
 }
@@ -218,7 +218,7 @@ function field_attach_insert($obj_type, &$object) {
  *
  * This function is an autoloader for _field_attach_update() in modules/field/field.attach.inc.
  */
-function field_attach_update($obj_type, &$object) {
+function field_attach_update($obj_type, $object) {
   require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
   return _field_attach_update($obj_type, $object);
 }
@@ -234,7 +234,7 @@ function field_attach_update($obj_type, &$object) {
  *
  * This function is an autoloader for _field_attach_delete() in modules/field/field.attach.inc.
  */
-function field_attach_delete($obj_type, &$object) {
+function field_attach_delete($obj_type, $object) {
   require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
   return _field_attach_delete($obj_type, $object);
 }
@@ -250,7 +250,7 @@ function field_attach_delete($obj_type, &$object) {
  *
  * This function is an autoloader for _field_attach_delete_revision() in modules/field/field.attach.inc.
  */
-function field_attach_delete_revision($obj_type, &$object) {
+function field_attach_delete_revision($obj_type, $object) {
   require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
   return _field_attach_delete_revision($obj_type, $object);
 }
@@ -272,7 +272,7 @@ function field_attach_delete_revision($obj_type, &$object) {
  *
  * This function is an autoloader for _field_attach_view() in modules/field/field.attach.inc.
  */
-function field_attach_view($obj_type, &$object, $teaser = FALSE) {
+function field_attach_view($obj_type, $object, $teaser = FALSE) {
   require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
   return _field_attach_view($obj_type, $object, $teaser);
 }
@@ -286,7 +286,7 @@ function field_attach_view($obj_type, &$object, $teaser = FALSE) {
  *
  * This function is an autoloader for _field_attach_preprocess() in modules/field/field.attach.inc.
  */
-function field_attach_preprocess($obj_type, &$object) {
+function field_attach_preprocess($obj_type, $object) {
   require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
   return _field_attach_preprocess($obj_type, $object);
 }
diff --git a/modules/field/field.default.inc b/modules/field/field.default.inc
index 74d853adeca8..f6069367607b 100644
--- a/modules/field/field.default.inc
+++ b/modules/field/field.default.inc
@@ -25,7 +25,7 @@ function field_default_validate($obj_type, $object, $field, $instance, $items) {
   // TODO: here we could validate that required fields are filled in (for programmatic save)
 }
 
-function field_default_submit($obj_type, &$object, $field, $instance, &$items, $form, &$form_state) {
+function field_default_submit($obj_type, $object, $field, $instance, &$items, $form, &$form_state) {
   $field_name = $field['field_name'];
 
   // TODO: should me move what's below to __extract_form_values ?
@@ -46,7 +46,7 @@ function field_default_submit($obj_type, &$object, $field, $instance, &$items, $
  * This can happen with programmatic saves, or on form-based creation where
  * the current user doesn't have 'edit' permission for the field.
  */
-function field_default_insert($obj_type, &$object, $field, $instance, &$items) {
+function field_default_insert($obj_type, $object, $field, $instance, &$items) {
   // _field_invoke() populates $items with an empty array if the $object has no
   // entry for the field, so we check on the $object itself.
   if (!property_exists($object, $field['field_name']) && !empty($instance['default_value_function'])) {
-- 
GitLab