diff --git "a/C:\\Documents and Settings\\kcraft\\Desktop\\Patches\\field-cleanup-docs-1326634-xenophyle-dellintosh-3.patch" "b/C:\\Documents and Settings\\kcraft\\Desktop\\Patches\\field-cleanup-docs-1326634-47.patch" index 9abfd13..357e025 100644 --- "a/C:\\Documents and Settings\\kcraft\\Desktop\\Patches\\field-cleanup-docs-1326634-xenophyle-dellintosh-3.patch" +++ "b/C:\\Documents and Settings\\kcraft\\Desktop\\Patches\\field-cleanup-docs-1326634-47.patch" @@ -1,5 +1,5 @@ diff --git a/core/modules/field/field.api.php b/core/modules/field/field.api.php -index 774d8b5..35496e2 100644 +index d9061e1..3384066 100644 --- a/core/modules/field/field.api.php +++ b/core/modules/field/field.api.php @@ -6,7 +6,7 @@ @@ -112,7 +112,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) { foreach ($items as $delta => $item) { -@@ -574,9 +573,9 @@ function hook_field_delete($entity_type, $entity, $field, $instance, $langcode, +@@ -597,9 +596,9 @@ function hook_field_delete($entity_type, $entity, $field, $instance, $langcode, /** * Define custom revision delete behavior for this module's field types. * @@ -125,7 +125,7 @@ index 774d8b5..35496e2 100644 * * @param $entity_type * The type of $entity. -@@ -614,7 +613,7 @@ function hook_field_delete_revision($entity_type, $entity, $field, $instance, $l +@@ -637,7 +636,7 @@ function hook_field_delete_revision($entity_type, $entity, $field, $instance, $l * @param $instance * The instance structure for $field on $entity's bundle. * @param $langcode @@ -134,7 +134,7 @@ index 774d8b5..35496e2 100644 * @param $items * $entity->{$field['field_name']}[$langcode], or an empty array if unset. * @param $source_entity -@@ -642,8 +641,8 @@ function hook_field_prepare_translation($entity_type, $entity, $field, $instance +@@ -665,8 +664,8 @@ function hook_field_prepare_translation($entity_type, $entity, $field, $instance * The field to which $item belongs. * * @return @@ -145,7 +145,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_is_empty($item, $field) { if (empty($item['value']) && (string) $item['value'] !== '0') { -@@ -682,30 +681,28 @@ function hook_field_is_empty($item, $field) { +@@ -705,30 +704,28 @@ function hook_field_is_empty($item, $field) { * Expose Field API widget types. * * @return @@ -189,7 +189,7 @@ index 774d8b5..35496e2 100644 * * @see hook_field_widget_info_alter() * @see hook_field_widget_form() -@@ -770,23 +767,23 @@ function hook_field_widget_info_alter(&$info) { +@@ -793,23 +790,23 @@ function hook_field_widget_info_alter(&$info) { * contains the base form element properties derived from the field * configuration. * @@ -222,7 +222,7 @@ index 774d8b5..35496e2 100644 * * Alternatively, hook_field_widget_form() can extract the needed specific * properties from $field and $instance and set them as ad-hoc -@@ -796,8 +793,8 @@ function hook_field_widget_info_alter(&$info) { +@@ -819,8 +816,8 @@ function hook_field_widget_info_alter(&$info) { * hook_field_widget_form_alter(). * * @param $form @@ -233,7 +233,7 @@ index 774d8b5..35496e2 100644 * @param $form_state * An associative array containing the current state of the form. * @param $field -@@ -817,11 +814,10 @@ function hook_field_widget_info_alter(&$info) { +@@ -840,11 +837,10 @@ function hook_field_widget_info_alter(&$info) { * - #field_name: The name of the field. * - #language: The language the field is being edited in. * - #field_parents: The 'parents' space for the field in the form. Most @@ -249,7 +249,7 @@ index 774d8b5..35496e2 100644 * - #columns: A list of field storage columns of the field. * - #title: The sanitized element label for the field instance, ready for * output. -@@ -859,14 +855,13 @@ function hook_field_widget_form(&$form, &$form_state, $field, $instance, $langco +@@ -882,14 +878,13 @@ function hook_field_widget_form(&$form, &$form_state, $field, $instance, $langco * @param $context * An associative array containing the following key-value pairs, matching the * arguments received by hook_field_widget_form(): @@ -271,7 +271,7 @@ index 774d8b5..35496e2 100644 * * @see hook_field_widget_form() * @see hook_field_widget_WIDGET_TYPE_form_alter -@@ -893,14 +888,13 @@ function hook_field_widget_form_alter(&$element, &$form_state, $context) { +@@ -916,14 +911,13 @@ function hook_field_widget_form_alter(&$element, &$form_state, $context) { * @param $context * An associative array containing the following key-value pairs, matching the * arguments received by hook_field_widget_form(): @@ -293,7 +293,7 @@ index 774d8b5..35496e2 100644 * * @see hook_field_widget_form() * @see hook_field_widget_form_alter() -@@ -922,12 +916,12 @@ function hook_field_widget_WIDGET_TYPE_form_alter(&$element, &$form_state, $cont +@@ -945,12 +939,12 @@ function hook_field_widget_WIDGET_TYPE_form_alter(&$element, &$form_state, $cont * @param $error * An associative array with the following key-value pairs, as returned by * hook_field_validate(): @@ -310,7 +310,7 @@ index 774d8b5..35496e2 100644 * @param $form_state * An associative array containing the current state of the form. */ -@@ -966,17 +960,17 @@ function hook_field_widget_error($element, $error, $form, &$form_state) { +@@ -989,17 +983,17 @@ function hook_field_widget_error($element, $error, $form, &$form_state) { * field_attach_view() functions. * * @return @@ -336,7 +336,7 @@ index 774d8b5..35496e2 100644 * * @see hook_field_formatter_info_alter() * @see hook_field_formatter_view() -@@ -1036,7 +1030,7 @@ function hook_field_formatter_info_alter(&$info) { +@@ -1059,7 +1053,7 @@ function hook_field_formatter_info_alter(&$info) { * * This should be used when a formatter needs to load additional information * from the database in order to render a field, for example a reference field @@ -345,7 +345,7 @@ index 774d8b5..35496e2 100644 * * This hook is called after the field type's own hook_field_prepare_view(). * -@@ -1045,6 +1039,9 @@ function hook_field_formatter_info_alter(&$info) { +@@ -1068,6 +1062,9 @@ function hook_field_formatter_info_alter(&$info) { * For performance reasons, information for all available entities should be * loaded in a single query where possible. * @@ -355,7 +355,7 @@ index 774d8b5..35496e2 100644 * @param $entity_type * The type of $entity. * @param $entities -@@ -1061,10 +1058,6 @@ function hook_field_formatter_info_alter(&$info) { +@@ -1084,10 +1081,6 @@ function hook_field_formatter_info_alter(&$info) { * Array of field values for the entities, keyed by entity ID. * @param $displays * Array of display settings to use for each entity, keyed by entity ID. @@ -366,7 +366,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_formatter_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $displays) { $tids = array(); -@@ -1123,13 +1116,13 @@ function hook_field_formatter_prepare_view($entity_type, $entities, $field, $ins +@@ -1146,13 +1139,13 @@ function hook_field_formatter_prepare_view($entity_type, $entities, $field, $ins * Array of values for this field. * @param $display * The display settings to use, as found in the 'display' entry of instance @@ -383,7 +383,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) { $element = array(); -@@ -1195,18 +1188,18 @@ function hook_field_formatter_view($entity_type, $entity, $field, $instance, $la +@@ -1218,18 +1211,18 @@ function hook_field_formatter_view($entity_type, $entity, $field, $instance, $la * @param $entity * The entity for which an edit form is being built. * @param $form @@ -408,7 +408,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_attach_form($entity_type, $entity, &$form, &$form_state, $langcode) { // Add a checkbox allowing a given field to be emptied. -@@ -1241,7 +1234,17 @@ function hook_field_attach_load($entity_type, $entities, $age, $options) { +@@ -1264,7 +1257,17 @@ function hook_field_attach_load($entity_type, $entities, $age, $options) { * * This hook is invoked after the field module has performed the operation. * @@ -427,7 +427,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_attach_validate($entity_type, $entity, &$errors) { // @todo Needs function body. -@@ -1258,8 +1261,8 @@ function hook_field_attach_validate($entity_type, $entity, &$errors) { +@@ -1281,8 +1284,8 @@ function hook_field_attach_validate($entity_type, $entity, &$errors) { * The entity for which an edit form is being submitted. The incoming form * values have been extracted as field values of the $entity object. * @param $form @@ -438,7 +438,7 @@ index 774d8b5..35496e2 100644 * property can be used to identify the corresponding part of * $form_state['values']. * @param $form_state -@@ -1279,7 +1282,10 @@ function hook_field_attach_submit($entity_type, $entity, $form, &$form_state) { +@@ -1302,7 +1305,10 @@ function hook_field_attach_submit($entity_type, $entity, $form, &$form_state) { * * This hook is invoked after the field module has performed the operation. * @@ -450,7 +450,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_attach_presave($entity_type, $entity) { // @todo Needs function body. -@@ -1290,7 +1296,10 @@ function hook_field_attach_presave($entity_type, $entity) { +@@ -1313,7 +1319,10 @@ function hook_field_attach_presave($entity_type, $entity) { * * This hook is invoked after the field module has performed the operation. * @@ -462,7 +462,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_attach_insert($entity_type, $entity) { // @todo Needs function body. -@@ -1301,7 +1310,10 @@ function hook_field_attach_insert($entity_type, $entity) { +@@ -1324,7 +1333,10 @@ function hook_field_attach_insert($entity_type, $entity) { * * This hook is invoked after the field module has performed the operation. * @@ -474,7 +474,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_attach_update($entity_type, $entity) { // @todo Needs function body. -@@ -1310,8 +1322,8 @@ function hook_field_attach_update($entity_type, $entity) { +@@ -1333,8 +1345,8 @@ function hook_field_attach_update($entity_type, $entity) { /** * Alter field_attach_preprocess() variables. * @@ -485,7 +485,7 @@ index 774d8b5..35496e2 100644 * * @param $variables * The variables array is passed by reference and will be populated with field -@@ -1331,7 +1343,10 @@ function hook_field_attach_preprocess_alter(&$variables, $context) { +@@ -1354,7 +1366,10 @@ function hook_field_attach_preprocess_alter(&$variables, $context) { * * This hook is invoked after the field module has performed the operation. * @@ -497,7 +497,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_attach_delete($entity_type, $entity) { // @todo Needs function body. -@@ -1342,7 +1357,10 @@ function hook_field_attach_delete($entity_type, $entity) { +@@ -1365,7 +1380,10 @@ function hook_field_attach_delete($entity_type, $entity) { * * This hook is invoked after the field module has performed the operation. * @@ -509,7 +509,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_attach_delete_revision($entity_type, $entity) { // @todo Needs function body. -@@ -1353,8 +1371,8 @@ function hook_field_attach_delete_revision($entity_type, $entity) { +@@ -1376,8 +1394,8 @@ function hook_field_attach_delete_revision($entity_type, $entity) { * * This hook is invoked in field_purge_data() and allows modules to act on * purging data from a single field pseudo-entity. For example, if a module @@ -520,7 +520,7 @@ index 774d8b5..35496e2 100644 * * @param $entity_type * The type of $entity; for example, 'node' or 'user'. -@@ -1390,9 +1408,9 @@ function hook_field_attach_purge($entity_type, $entity, $field, $instance) { +@@ -1413,9 +1431,9 @@ function hook_field_attach_purge($entity_type, $entity, $field, $instance) { * - display: Either a view mode string or an array of display settings. If * this hook is being invoked from field_attach_view(), the 'display' * element is set to the view mode string. If this hook is being invoked @@ -533,7 +533,7 @@ index 774d8b5..35496e2 100644 * - language: The language code used for rendering. */ function hook_field_attach_view_alter(&$output, $context) { -@@ -1423,9 +1441,9 @@ function hook_field_attach_view_alter(&$output, $context) { +@@ -1446,9 +1464,9 @@ function hook_field_attach_view_alter(&$output, $context) { * @param $context * An associative array containing: * - entity_type: The type of $entity; e.g. 'node' or 'user'. @@ -545,7 +545,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_attach_prepare_translation_alter(&$entity, $context) { if ($context['entity_type'] == 'custom_entity_type') { -@@ -1482,7 +1500,10 @@ function hook_field_available_languages_alter(&$languages, $context) { +@@ -1505,7 +1523,10 @@ function hook_field_available_languages_alter(&$langcodes, $context) { * * This hook is invoked after the field module has performed the operation. * @@ -557,7 +557,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_attach_create_bundle($entity_type, $bundle) { // When a new bundle is created, the menu needs to be rebuilt to add the -@@ -1495,7 +1516,12 @@ function hook_field_attach_create_bundle($entity_type, $bundle) { +@@ -1518,7 +1539,12 @@ function hook_field_attach_create_bundle($entity_type, $bundle) { * * This hook is invoked after the field module has performed the operation. * @@ -571,7 +571,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new) { // Update the extra weights variable with new information. -@@ -1544,16 +1570,16 @@ function hook_field_attach_delete_bundle($entity_type, $bundle, $instances) { +@@ -1567,16 +1593,16 @@ function hook_field_attach_delete_bundle($entity_type, $bundle, $instances) { * Expose Field API storage backends. * * @return @@ -595,7 +595,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_storage_info() { return array( -@@ -1586,8 +1612,8 @@ function hook_field_storage_info_alter(&$info) { +@@ -1609,8 +1635,8 @@ function hook_field_storage_info_alter(&$info) { * the table. A key/value storage module might return the server name, * authentication credentials, and bin name. * @@ -606,7 +606,7 @@ index 774d8b5..35496e2 100644 * * @param $field * A field structure. -@@ -1652,12 +1678,11 @@ function hook_field_storage_details_alter(&$details, $field) { +@@ -1675,12 +1701,11 @@ function hook_field_storage_details_alter(&$details, $field) { /** * Load field data for a set of entities. * @@ -622,7 +622,7 @@ index 774d8b5..35496e2 100644 * * @param $entity_type * The type of entity, such as 'node' or 'user'. -@@ -1672,9 +1697,8 @@ function hook_field_storage_details_alter(&$details, $field) { +@@ -1695,9 +1720,8 @@ function hook_field_storage_details_alter(&$details, $field) { * depending on the $age parameter) to add each field to. * @param $options * An associative array of additional options, with the following keys: @@ -634,7 +634,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_storage_load($entity_type, $entities, $age, $fields, $options) { $field_info = field_info_field_by_ids(); -@@ -1724,8 +1748,8 @@ function hook_field_storage_load($entity_type, $entities, $age, $fields, $option +@@ -1747,8 +1771,8 @@ function hook_field_storage_load($entity_type, $entities, $age, $fields, $option /** * Write field data for an entity. * @@ -645,7 +645,7 @@ index 774d8b5..35496e2 100644 * * @param $entity_type * The entity type of entity, such as 'node' or 'user'. -@@ -1735,8 +1759,8 @@ function hook_field_storage_load($entity_type, $entities, $age, $fields, $option +@@ -1758,8 +1782,8 @@ function hook_field_storage_load($entity_type, $entities, $age, $fields, $option * FIELD_STORAGE_UPDATE when updating an existing entity, * FIELD_STORAGE_INSERT when inserting a new entity. * @param $fields @@ -656,7 +656,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_storage_write($entity_type, $entity, $op, $fields) { list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); -@@ -1829,8 +1853,8 @@ function hook_field_storage_write($entity_type, $entity, $op, $fields) { +@@ -1852,8 +1876,8 @@ function hook_field_storage_write($entity_type, $entity, $op, $fields) { * @param $entity * The entity on which to operate. * @param $fields @@ -667,7 +667,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_storage_delete($entity_type, $entity, $fields) { list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); -@@ -1849,18 +1873,18 @@ function hook_field_storage_delete($entity_type, $entity, $fields) { +@@ -1872,18 +1896,18 @@ function hook_field_storage_delete($entity_type, $entity, $fields) { * This hook is invoked from field_attach_delete_revision() to ask the field * storage module to delete field revision data. * @@ -693,7 +693,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_storage_delete_revision($entity_type, $entity, $fields) { list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); -@@ -1997,8 +2021,8 @@ function hook_field_storage_query($query) { +@@ -2020,8 +2044,8 @@ function hook_field_storage_query($query) { * Act on creation of a new field. * * This hook is invoked from field_create_field() to ask the field storage @@ -704,7 +704,7 @@ index 774d8b5..35496e2 100644 * * @param $field * The field structure being created. -@@ -2069,13 +2093,13 @@ function hook_field_storage_delete_instance($instance) { +@@ -2092,13 +2116,13 @@ function hook_field_storage_delete_instance($instance) { * This hook allows modules to load data before the Field Storage API, * optionally preventing the field storage module from doing so. * @@ -723,7 +723,7 @@ index 774d8b5..35496e2 100644 * * @param $entity_type * The type of entity, such as 'node' or 'user'. -@@ -2090,11 +2114,10 @@ function hook_field_storage_delete_instance($instance) { +@@ -2113,11 +2137,10 @@ function hook_field_storage_delete_instance($instance) { * that your module has already loaded a field. * @param $options * An associative array of additional options, with the following keys: @@ -739,7 +739,7 @@ index 774d8b5..35496e2 100644 */ function hook_field_storage_pre_load($entity_type, $entities, $age, &$skip_fields, $options) { // @todo Needs function body. -@@ -2217,7 +2240,7 @@ function hook_field_info_max_weight($entity_type, $bundle, $context) { +@@ -2240,7 +2263,7 @@ function hook_field_info_max_weight($entity_type, $bundle, $context) { } /** @@ -748,7 +748,7 @@ index 774d8b5..35496e2 100644 * * Note that instead of hook_field_display_alter(), which is called for all * fields on all entity types, hook_field_display_ENTITY_TYPE_alter() may be -@@ -2252,7 +2275,7 @@ function hook_field_display_alter(&$display, $context) { +@@ -2275,7 +2298,7 @@ function hook_field_display_alter(&$display, $context) { } /** @@ -757,7 +757,7 @@ index 774d8b5..35496e2 100644 * * Modules can implement hook_field_display_ENTITY_TYPE_alter() to alter display * settings for fields on a specific entity type, rather than implementing -@@ -2290,8 +2313,8 @@ function hook_field_display_ENTITY_TYPE_alter(&$display, $context) { +@@ -2313,8 +2336,8 @@ function hook_field_display_ENTITY_TYPE_alter(&$display, $context) { * cache the information. * * @param $displays @@ -768,7 +768,7 @@ index 774d8b5..35496e2 100644 * @param $context * An associative array containing: * - entity_type: The entity type; e.g., 'node' or 'user'. -@@ -2305,15 +2328,15 @@ function hook_field_extra_fields_display_alter(&$displays, $context) { +@@ -2328,15 +2351,15 @@ function hook_field_extra_fields_display_alter(&$displays, $context) { } /** @@ -787,7 +787,7 @@ index 774d8b5..35496e2 100644 * statically cache the information. * * @param $widget -@@ -2404,16 +2427,15 @@ function hook_field_create_instance($instance) { +@@ -2427,16 +2450,15 @@ function hook_field_create_instance($instance) { } /** @@ -811,7 +811,7 @@ index 774d8b5..35496e2 100644 * * @param $field * The field as it will be post-update. -@@ -2526,11 +2548,11 @@ function hook_field_read_instance($instance) { +@@ -2549,11 +2571,11 @@ function hook_field_read_instance($instance) { /** * Acts when a field record is being purged. * @@ -828,7 +828,7 @@ index 774d8b5..35496e2 100644 * * @param $field * The field being purged. -@@ -2544,11 +2566,11 @@ function hook_field_purge_field($field) { +@@ -2567,11 +2589,11 @@ function hook_field_purge_field($field) { /** * Acts when a field instance is being purged. * @@ -845,7 +845,7 @@ index 774d8b5..35496e2 100644 * * @param $instance * The instance being purged. -@@ -2562,8 +2584,8 @@ function hook_field_purge_instance($instance) { +@@ -2585,8 +2607,8 @@ function hook_field_purge_instance($instance) { /** * Remove field storage information when a field record is purged. * @@ -856,7 +856,7 @@ index 774d8b5..35496e2 100644 * * @param $field * The field being purged. -@@ -2578,9 +2600,8 @@ function hook_field_storage_purge_field($field) { +@@ -2601,9 +2623,8 @@ function hook_field_storage_purge_field($field) { /** * Remove field storage information when a field instance is purged. * @@ -868,7 +868,7 @@ index 774d8b5..35496e2 100644 * * @param $instance * The instance being purged. -@@ -2594,8 +2615,8 @@ function hook_field_storage_purge_field_instance($instance) { +@@ -2617,8 +2638,8 @@ function hook_field_storage_purge_field_instance($instance) { /** * Remove field storage information when field data is purged. * @@ -880,7 +880,7 @@ index 774d8b5..35496e2 100644 * @param $entity_type * The type of $entity; for example, 'node' or 'user'. diff --git a/core/modules/field/field.attach.inc b/core/modules/field/field.attach.inc -index 34826cb..4f30bf4 100644 +index ff579c7..56ac45f 100644 --- a/core/modules/field/field.attach.inc +++ b/core/modules/field/field.attach.inc @@ -6,22 +6,24 @@ @@ -1023,7 +1023,7 @@ index 34826cb..4f30bf4 100644 - * - 'deleted': If TRUE, the function will operate on deleted fields - * as well as non-deleted fields. If unset or FALSE, only - * non-deleted fields are operated on. -- * - 'language': A language code or an array of language codes keyed by field +- * - 'langcode': A language code or an array of language codes keyed by field - * name. It will be used to narrow down to a single value the available - * languages to act on. + * - field_name: The name of the field whose operation should be invoked. By @@ -1044,7 +1044,7 @@ index 34826cb..4f30bf4 100644 + * - deleted: If TRUE, the function will operate on deleted fields as well as + * non-deleted fields. If unset or FALSE, only non-deleted fields are + * operated on. -+ * - language: A language code or an array of language codes keyed by field ++ * - langcode: A language code or an array of language codes keyed by field + * name. It will be used to narrow down to a single value the available + * languages to act on. + * @@ -1096,9 +1096,9 @@ index 34826cb..4f30bf4 100644 - * - 'deleted': If TRUE, the function will operate on deleted fields - * as well as non-deleted fields. If unset or FALSE, only - * non-deleted fields are operated on. -- * - 'language': A language code or an array of arrays of language codes keyed +- * - 'langcode': A language code or an array of arrays of language codes keyed - * by entity id and field name. It will be used to narrow down to a single -- * value the available languages to act on. +- * value the available language codes to act on. + * - field_name: The name of the field whose operation should be invoked. By + * default, the operation is invoked on all the fields in the entity's + * bundle. NOTE: This option is not compatible with the 'deleted' option; @@ -1117,7 +1117,7 @@ index 34826cb..4f30bf4 100644 + * - deleted: If TRUE, the function will operate on deleted fields as well as + * non-deleted fields. If unset or FALSE, only non-deleted fields are + * operated on. -+ * - language: A language code or an array of arrays of language codes keyed ++ * - langcode: A language code or an array of arrays of language codes keyed + * by entity ID and field name. It will be used to narrow down to a single + * value the available languages to act on. * @@ -1609,7 +1609,7 @@ index 34826cb..4f30bf4 100644 + * The source language from which to translate. */ function field_attach_prepare_translation($entity_type, $entity, $langcode, $source_entity, $source_langcode) { - $options = array('language' => $langcode); + $options = array('langcode' => $langcode); @@ -1282,7 +1370,7 @@ function field_attach_prepare_translation($entity_type, $entity, $langcode, $sou } @@ -1646,7 +1646,7 @@ index 34826cb..4f30bf4 100644 * simple DELETE query). * diff --git a/core/modules/field/field.crud.inc b/core/modules/field/field.crud.inc -index f9c96c9..8eb6e33 100644 +index f9c96c9..2128bcd 100644 --- a/core/modules/field/field.crud.inc +++ b/core/modules/field/field.crud.inc @@ -8,13 +8,12 @@ @@ -1741,7 +1741,7 @@ index f9c96c9..8eb6e33 100644 * @see field_create_field() */ function field_update_field($field) { -@@ -297,16 +296,15 @@ function field_update_field($field) { +@@ -297,16 +296,16 @@ function field_update_field($field) { * * Generally, you should use the field_info_field() instead. * @@ -1760,10 +1760,11 @@ index f9c96c9..8eb6e33 100644 + * The default behavior of this function is to not return a field that is + * inactive. Setting $include_additional['include_inactive'] to TRUE will + * override this behavior. ++ * * @return * A field definition array, or FALSE. */ -@@ -321,15 +319,14 @@ function field_read_field($field_name, $include_additional = array()) { +@@ -321,15 +320,15 @@ function field_read_field($field_name, $include_additional = array()) { * @param array $params * An array of conditions to match against. * @param array $include_additional @@ -1775,6 +1776,7 @@ index f9c96c9..8eb6e33 100644 - * $include_additional['include_deleted'] to TRUE will override this - * behavior. + * $include_additional['include_deleted'] to TRUE will override this behavior. ++ * * @return * An array of fields matching $params. If - * $include_additional['include_deleted'] is TRUE, the array is keyed @@ -1784,7 +1786,7 @@ index f9c96c9..8eb6e33 100644 */ function field_read_fields($params = array(), $include_additional = array()) { $query = db_select('field_config', 'fc', array('fetch' => PDO::FETCH_ASSOC)); -@@ -420,32 +417,31 @@ function field_delete_field($field_name) { +@@ -420,32 +419,31 @@ function field_delete_field($field_name) { * Creates an instance of a field, binding it to a bundle. * * @param $instance @@ -1818,7 +1820,7 @@ index f9c96c9..8eb6e33 100644 - * - label: 'above' - * - type: the default formatter specified in hook_field_info(). - * - settings: each omitted setting is given the default value specified in -+ * - display: Settings for the 'default' view mode will be added if not ++ * - display: Settings for the 'default' view mode will be added if not + * present, and each view mode in the definition will be completed with the + * following default values: + * - label: "above". @@ -1834,7 +1836,7 @@ index f9c96c9..8eb6e33 100644 * * @throws FieldException * -@@ -505,12 +501,12 @@ function field_create_instance($instance) { +@@ -505,12 +503,12 @@ function field_create_instance($instance) { * Updates an instance of a field. * * @param $instance @@ -1850,7 +1852,7 @@ index f9c96c9..8eb6e33 100644 * properties specified in $instance overwrite the existing values for * the instance. * -@@ -638,9 +634,9 @@ function _field_write_instance($instance, $update = FALSE) { +@@ -638,9 +636,9 @@ function _field_write_instance($instance, $update = FALSE) { /** * Reads a single instance record from the database. * @@ -1863,7 +1865,7 @@ index f9c96c9..8eb6e33 100644 * * @param $entity_type * The type of entity to which the field is bound. -@@ -649,11 +645,11 @@ function _field_write_instance($instance, $update = FALSE) { +@@ -649,11 +647,11 @@ function _field_write_instance($instance, $update = FALSE) { * @param $bundle * The bundle to which the field is bound. * @param array $include_additional @@ -1879,7 +1881,7 @@ index f9c96c9..8eb6e33 100644 * @return * An instance structure, or FALSE. */ -@@ -666,15 +662,14 @@ function field_read_instance($entity_type, $field_name, $bundle, $include_additi +@@ -666,15 +664,15 @@ function field_read_instance($entity_type, $field_name, $bundle, $include_additi * Reads in field instances that match an array of conditions. * * @param $param @@ -1899,10 +1901,11 @@ index f9c96c9..8eb6e33 100644 + * have been marked deleted, or whose field is inactive. Setting + * $include_additional['include_inactive'] or + * $include_additional['include_deleted'] to TRUE will override this behavior. ++ * * @return * An array of instances matching the arguments. */ -@@ -765,7 +760,7 @@ function field_delete_instance($instance, $field_cleanup = TRUE) { +@@ -765,7 +763,7 @@ function field_delete_instance($instance, $field_cleanup = TRUE) { /** * @defgroup field_purge Field API bulk data deletion * @{ @@ -1911,7 +1914,7 @@ index f9c96c9..8eb6e33 100644 * * Field API provides functions for deleting data attached to individual * entities as well as deleting entire fields or field instances in a single -@@ -774,20 +769,19 @@ function field_delete_instance($instance, $field_cleanup = TRUE) { +@@ -774,20 +772,19 @@ function field_delete_instance($instance, $field_cleanup = TRUE) { * Deleting field data items for an entity with field_attach_delete() involves * three separate operations: * - Invoking the Field Type API hook_field_delete() for each field on the @@ -1943,7 +1946,7 @@ index f9c96c9..8eb6e33 100644 * * When a field, bundle, or field instance is deleted, it is not practical to * invoke these hooks immediately on every affected entity in a single page -@@ -795,8 +789,8 @@ function field_delete_instance($instance, $field_cleanup = TRUE) { +@@ -795,8 +792,8 @@ function field_delete_instance($instance, $field_cleanup = TRUE) { * appropriate field data items, instances, and/or fields are marked as deleted * so that subsequent load or query operations will not return them. Later, a * separate process cleans up, or "purges", the marked-as-deleted data by going @@ -1954,7 +1957,7 @@ index f9c96c9..8eb6e33 100644 * * Purging field data is made somewhat tricky by the fact that, while * field_attach_delete() has a complete entity to pass to the various deletion -@@ -808,12 +802,12 @@ function field_delete_instance($instance, $field_cleanup = TRUE) { +@@ -808,12 +805,12 @@ function field_delete_instance($instance, $field_cleanup = TRUE) { * * Field API resolves this problem by using "pseudo-entities" during purge * operations. A pseudo-entity contains only the information from the original @@ -1973,7 +1976,7 @@ index f9c96c9..8eb6e33 100644 * * @code * $entity = stdClass Object( -@@ -890,8 +884,8 @@ function field_purge_batch($batch_size) { +@@ -890,8 +887,8 @@ function field_purge_batch($batch_size) { /** * Purges the field data for a single field on a single pseudo-entity. * @@ -1984,7 +1987,7 @@ index f9c96c9..8eb6e33 100644 * possible that other field data will remain attached to it. * * @param $entity_type -@@ -922,7 +916,7 @@ function field_purge_data($entity_type, $entity, $field, $instance) { +@@ -922,7 +919,7 @@ function field_purge_data($entity_type, $entity, $field, $instance) { /** * Purges a field instance record from the database. * @@ -2385,7 +2388,7 @@ index be3685d..4c3783d 100644 * field_widget_instance() instead of field_info_field() and * field_info_instance() when they need to access field or instance properties. diff --git a/core/modules/field/field.info.inc b/core/modules/field/field.info.inc -index 78bc62e..b234cc8 100644 +index 78bc62e..9289bfb 100644 --- a/core/modules/field/field.info.inc +++ b/core/modules/field/field.info.inc @@ -8,11 +8,11 @@ @@ -2669,8 +2672,80 @@ index 78bc62e..b234cc8 100644 * * @return * The array of pseudo-field elements in the bundle. +@@ -794,6 +806,7 @@ function field_info_extra_fields($entity_type, $bundle, $context) { + * @param $context + * The context for which the maximum weight is requested. Either 'form', or + * the name of a view mode. ++ * + * @return + * The maximum weight of the entity's components, or NULL if no components + * were found. +diff --git a/core/modules/field/field.install b/core/modules/field/field.install +index dc7ec6c..3bb5da6 100644 +--- a/core/modules/field/field.install ++++ b/core/modules/field/field.install +@@ -2,7 +2,7 @@ + + /** + * @file +- * Install, update and uninstall functions for the field module. ++ * Install, update, and uninstall functions for the Field module. + */ + + /** +@@ -167,7 +167,7 @@ function field_schema() { + } + + /** +- * Utility function: create a field by writing directly to the database. ++ * Creates a field by writing directly to the database. + * + * @ingroup update-api-7.x-to-8.x + */ +@@ -237,7 +237,7 @@ function _update_7000_field_create_field(&$field) { + } + + /** +- * Utility function: delete a field stored in SQL storage directly from the database. ++ * Deletes a field stored in SQL storage directly from the database. + * + * To protect user data, this function can only be used to delete fields once + * all information it stored is gone. Delete all data from the +@@ -272,9 +272,9 @@ function _update_7000_field_delete_field($field_name) { + + + /** +- * Utility function: delete an instance and all its data of a field stored in SQL Storage. ++ * Deletes an instance and all its data of a field stored in SQL Storage. + * +- * BEWARE: this function deletes user data from the field storage tables. ++ * BEWARE: This function deletes user data from the field storage tables. + * + * @ingroup update-api-7.x-to-8.x + */ +@@ -298,9 +298,9 @@ function _update_7000_field_delete_instance($field_name, $entity_type, $bundle) + } + + /** +- * Utility function: fetch all the field definitions from the database. ++ * Fetches all of the field definitions from the database. + * +- * Warning: unlike the field_read_fields() API function, this function returns ++ * Warning: Unlike the field_read_fields() API function, this function returns + * all fields by default, including deleted and inactive fields, unless + * specified otherwise in the $conditions parameter. + * +@@ -344,7 +344,7 @@ function _update_8000_field_read_fields(array $conditions = array(), $key = 'id' + } + + /** +- * Utility function: write a field instance directly to the database. ++ * Writes a field instance directly to the database. + * + * @ingroup update-api-7.x-to-8.x + */ diff --git a/core/modules/field/field.module b/core/modules/field/field.module -index 1ea128b..c23b831 100644 +index 2f3041c..aeb7538 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -1,14 +1,14 @@ @@ -2697,8 +2772,7 @@ index 1ea128b..c23b831 100644 * @defgroup field Field API * @{ - * Attach custom data fields to Drupal entities. -+ * Attaches custom data fields to Drupal entities. - * +- * - * The Field API allows custom data fields to be attached to Drupal - * entities and takes care of storing, loading, editing, and rendering - * field data. Any entity type (node, user, etc.) can use the Field @@ -2706,25 +2780,14 @@ index 1ea128b..c23b831 100644 - * to it. Other modules can provide a user interface for managing custom - * fields via a web browser as well as a wide and flexible variety of - * data type, form element, and display format capabilities. -+ * The Field API allows custom data fields to be attached to Drupal entities and -+ * takes care of storing, loading, editing, and rendering field data. Any entity -+ * type (node, user, etc.) can use the Field API to make itself "fieldable" and -+ * thus allow fields to be attached to it. Other modules can provide a user -+ * interface for managing custom fields via a web browser as well as a wide and -+ * flexible variety of data type, form element, and display format capabilities. - * +- * - * The Field API defines two primary data structures, Field and - * Instance, and the concept of a Bundle. A Field defines a - * particular type of data that can be attached to entities. A Field - * Instance is a Field attached to a single Bundle. A Bundle is a set - * of fields that are treated as a group by the Field Attach API and - * is related to a single fieldable entity type. -+ * The Field API defines two primary data structures, Field and Instance, and -+ * the concept of a Bundle. A Field defines a particular type of data that can -+ * be attached to entities. A Field Instance is a Field attached to a single -+ * Bundle. A Bundle is a set of fields that are treated as a group by the Field -+ * Attach API and is related to a single fieldable entity type. - * +- * - * For example, suppose a site administrator wants Article nodes to - * have a subtitle and photo. Using the Field API or Field UI module, - * the administrator creates a field named 'subtitle' of type 'text' @@ -2737,6 +2800,21 @@ index 1ea128b..c23b831 100644 - * content type (which is 'article') as the node's bundle. - * field_attach_load() then loads the 'subtitle' and 'photo' fields - * because they are both attached to the 'node' bundle 'article'. ++ * Attaches custom data fields to Drupal entities. ++ * ++ * The Field API allows custom data fields to be attached to Drupal entities and ++ * takes care of storing, loading, editing, and rendering field data. Any entity ++ * type (node, user, etc.) can use the Field API to make itself "fieldable" and ++ * thus allow fields to be attached to it. Other modules can provide a user ++ * interface for managing custom fields via a web browser as well as a wide and ++ * flexible variety of data type, form element, and display format capabilities. ++ * ++ * The Field API defines two primary data structures, Field and Instance, and ++ * the concept of a Bundle. A Field defines a particular type of data that can ++ * be attached to entities. A Field Instance is a Field attached to a single ++ * Bundle. A Bundle is a set of fields that are treated as a group by the Field ++ * Attach API and is related to a single fieldable entity type. ++ * + * For example, suppose a site administrator wants Article nodes to have a + * subtitle and photo. Using the Field API or Field UI module, the administrator + * creates a field named 'subtitle' of type 'text' and a field named 'photo' of @@ -2973,54 +3051,60 @@ index 1ea128b..c23b831 100644 - * widget types, and display formatters. Field modules use this API - * to provide field types like Text and Node Reference along with the - * associated form elements and display formatters. -+ * - @link field_types Field Types API @endlink: Defines field types, widget -+ * types, and display formatters. Field modules use this API to provide field -+ * types like Text and Node Reference along with the associated form elements -+ * and display formatters. - * +- * - * - @link field_crud Field CRUD API @endlink. Create, updates, and - * deletes fields, bundles (a.k.a. "content types"), and instances. - * Modules use this API, often in hook_install(), to create - * custom data structures. -+ * - @link field_crud Field CRUD API @endlink: Create, updates, and deletes -+ * fields, bundles (a.k.a. "content types"), and instances. Modules use this -+ * API, often in hook_install(), to create custom data structures. - * +- * - * - @link field_attach Field Attach API @endlink. Connects entity - * types to the Field API. Field Attach API functions load, store, - * generate Form API structures, display, and perform a variety of - * other functions for field data connected to individual entities. - * Fieldable entity types like node and user use this API to make - * themselves fieldable. +- * +- * - @link field_info Field Info API @endlink. Exposes information +- * about all fields, instances, widgets, and related information +- * defined by or with the Field API. +- * +- * - @link field_storage Field Storage API @endlink. Provides a +- * pluggable back-end storage system for actual field data. The +- * default implementation, field_sql_storage.module, stores field data +- * in the local SQL database. +- * +- * - @link field_purge Field API bulk data deletion @endlink. Cleans +- * up after bulk deletion operations such as field_delete_field() +- * and field_delete_instance(). +- * +- * - @link field_language Field language API @endlink. Provides native ++ * - @link field_types Field Types API @endlink: Defines field types, widget ++ * types, and display formatters. Field modules use this API to provide field ++ * types like Text and Node Reference along with the associated form elements ++ * and display formatters. ++ * ++ * - @link field_crud Field CRUD API @endlink: Create, updates, and deletes ++ * fields, bundles (a.k.a. "content types"), and instances. Modules use this ++ * API, often in hook_install(), to create custom data structures. ++ * + * - @link field_attach Field Attach API @endlink: Connects entity types to the + * Field API. Field Attach API functions load, store, generate Form API + * structures, display, and perform a variety of other functions for field + * data connected to individual entities. Fieldable entity types like node and + * user use this API to make themselves fieldable. - * -- * - @link field_info Field Info API @endlink. Exposes information -- * about all fields, instances, widgets, and related information -- * defined by or with the Field API. ++ * + * - @link field_info Field Info API @endlink: Exposes information about all + * fields, instances, widgets, and related information defined by or with the + * Field API. - * -- * - @link field_storage Field Storage API @endlink. Provides a -- * pluggable back-end storage system for actual field data. The -- * default implementation, field_sql_storage.module, stores field data -- * in the local SQL database. ++ * + * - @link field_storage Field Storage API @endlink: Provides a pluggable back + * -end storage system for actual field data. The default implementation, + * field_sql_storage.module, stores field data in the local SQL database. - * -- * - @link field_purge Field API bulk data deletion @endlink. Cleans -- * up after bulk deletion operations such as field_delete_field() -- * and field_delete_instance(). ++ * + * - @link field_purge Field API bulk data deletion @endlink: Cleans up after + * bulk deletion operations such as field_delete_field() and + * field_delete_instance(). - * -- * - @link field_language Field language API @endlink. Provides native ++ * + * - @link field_language Field language API @endlink: Provides native * multilingual support for the Field API. */ @@ -3133,12 +3217,12 @@ index 1ea128b..c23b831 100644 - * allowed values, where some (mainly inline) mark-up may be desired - * (so check_plain() is not acceptable). + * Used for items entered by administrators, like field descriptions, allowed -+ * values, where some (mainly inline) mark-up may be desired (so drupal_htmlspecialchars() -+ * is not acceptable). ++ * values, where some (mainly inline) mark-up may be desired (so ++ * drupal_htmlspecialchars() is not acceptable). + * + * @param $string + * The string with raw HTML in it. -+ * ++ * + * @return + * An XSS safe version of $string, or an empty string if $string is not valid + * UTF-8. @@ -3170,7 +3254,7 @@ index 1ea128b..c23b831 100644 * key and the field data to display. * @param $field_name * The name of the field to display. -@@ -790,11 +802,11 @@ function _field_filter_xss_display_allowed_tags() { +@@ -790,11 +802,12 @@ function _field_filter_xss_display_allowed_tags() { * The field value to display, as found in * $entity->field_name[$langcode][$delta]. * @param $display @@ -3183,10 +3267,11 @@ index 1ea128b..c23b831 100644 - * current language will be assumed. + * (Optional) The language of the value in $item. If not provided, the current + * language will be assumed. ++ * * @return * A renderable array for the field value. */ -@@ -841,7 +853,7 @@ function field_view_value($entity_type, $entity, $field_name, $item, $display = +@@ -841,7 +854,7 @@ function field_view_value($entity_type, $entity, $field_name, $item, $display = * @param $entity_type * The type of $entity; e.g., 'node' or 'user'. * @param $entity @@ -3195,7 +3280,7 @@ index 1ea128b..c23b831 100644 * key and the field data to display. * @param $field_name * The name of the field to display. -@@ -849,28 +861,27 @@ function field_view_value($entity_type, $entity, $field_name, $item, $display = +@@ -849,28 +862,28 @@ function field_view_value($entity_type, $entity, $field_name, $item, $display = * Can be either: * - The name of a view mode. The field will be displayed according to the * display settings specified for this view mode in the $instance @@ -3224,17 +3309,16 @@ index 1ea128b..c23b831 100644 * - weight: (float) The weight to assign to the renderable element. * Defaults to 0. * @param $langcode - * (Optional) The language the field values are to be shown in. The site's -- * current language fallback logic will be applied no values are available -- * for the language. If no language is provided the current language will be -- * used. -+ * current language fallback logic will be applied no values are available for -+ * the language. If no language is provided the current language will be used. + * (Optional) The language code the field values are to be shown in. The + * site's current language fallback logic will be applied when no values are +- * available for given language code. If no language code is provided the ++ * available for the given language code. If no language code is provided the + * current language will be used. + * * @return * A renderable array for the field value. * -@@ -946,7 +957,7 @@ function field_get_items($entity_type, $entity, $field_name, $langcode = NULL) { +@@ -946,10 +959,11 @@ function field_get_items($entity_type, $entity, $field_name, $langcode = NULL) { } /** @@ -3243,7 +3327,11 @@ index 1ea128b..c23b831 100644 * * @param $field * A field structure. -@@ -963,12 +974,12 @@ function field_has_data($field) { ++ * + * @return + * TRUE if the field has data for any entity; FALSE otherwise. + */ +@@ -963,12 +977,12 @@ function field_has_data($field) { } /** @@ -3259,7 +3347,7 @@ index 1ea128b..c23b831 100644 * @param array $field * The full field structure array for the field on which the operation is to * be performed. See field_info_field(). -@@ -980,8 +991,7 @@ function field_has_data($field) { +@@ -980,8 +994,7 @@ function field_has_data($field) { * (optional) The account to check, if not given use currently logged in user. * * @return @@ -3269,7 +3357,7 @@ index 1ea128b..c23b831 100644 */ function field_access($op, $field, $entity_type, $entity = NULL, $account = NULL) { global $user; -@@ -1001,7 +1011,7 @@ function field_access($op, $field, $entity_type, $entity = NULL, $account = NULL +@@ -1001,13 +1014,14 @@ function field_access($op, $field, $entity_type, $entity = NULL, $account = NULL } /** @@ -3278,7 +3366,14 @@ index 1ea128b..c23b831 100644 * * @param $entity_type * The type of $entity; e.g., 'node' or 'user'. -@@ -1136,8 +1146,8 @@ function template_process_field(&$variables, $hook) { + * @param $bundle + * The bundle object (or string if bundles for this entity type do not exist + * as standalone objects). ++ * + * @return + * The bundle name. + */ +@@ -1136,8 +1150,8 @@ function template_process_field(&$variables, $hook) { * So, if the body field on the article content type needs customization, a * field--body--article.tpl.php file can be added within the theme's folder. * Because it's a template, it will result in slightly more time needed to @@ -3289,7 +3384,7 @@ index 1ea128b..c23b831 100644 * guideline is that if a page is being displayed with more than 100 fields and * they are all themed with a template instead of a function, it can add up to * 5% to the time it takes to display that page. This is a guideline only and -@@ -1146,7 +1156,8 @@ function template_process_field(&$variables, $hook) { +@@ -1146,7 +1160,8 @@ function template_process_field(&$variables, $hook) { * * @param $variables * An associative array containing: @@ -3300,7 +3395,7 @@ index 1ea128b..c23b831 100644 * - label: The label for the field. * - content_attributes: A string containing the attributes for the content's diff --git a/core/modules/field/field.multilingual.inc b/core/modules/field/field.multilingual.inc -index a4f5f8f..f199726 100644 +index f054bf1..7a53324 100644 --- a/core/modules/field/field.multilingual.inc +++ b/core/modules/field/field.multilingual.inc @@ -8,7 +8,7 @@ @@ -3312,40 +3407,34 @@ index a4f5f8f..f199726 100644 * * Fields natively implement multilingual support, and all fields use the * following structure: -@@ -32,10 +32,10 @@ +@@ -32,10 +32,16 @@ * module registering itself via hook_entity_info() to handle field * translations. * -- * By default, _field_invoke() and _field_invoke_multiple() are processing a -- * field in all available languages, unless they are given a language -- * suggestion. Based on that suggestion, _field_language_suggestion() determines -- * the languages to act on. ++ + * By default, _field_invoke() and _field_invoke_multiple() are processing a + * field in all available languages, unless they are given a language code + * suggestion. Based on that suggestion, _field_language_suggestion() determines + * the languages to act on. ++ + * By default, _field_invoke() and _field_invoke_multiple() process a field in -+ * all available languages, unless they are given a language suggestion. Based -+ * on that suggestion, _field_language_suggestion() determines the languages to -+ * act on. ++ * all available languages, unless they are given a language code suggestion. ++ * Based on that suggestion, _field_language_suggestion() determines the ++ * languages to act on. * - * Most field_attach_*() functions act on all available languages, except for - * the following: -@@ -128,7 +128,7 @@ function field_available_languages($entity_type, $field) { + * Most field_attach_*() functions act on all available language codes, except + * for the following: +@@ -128,8 +134,7 @@ function field_available_languages($entity_type, $field) { } /** -- * Process the given language suggestion based on the available languages. -+ * Processes the given language suggestion based on the available languages. - * - * If a non-empty language suggestion is provided it must appear among the - * available languages, otherwise it will be ignored. -@@ -164,7 +164,7 @@ function _field_language_suggestion($available_languages, $language_suggestion, - /** - * Returns available content languages. - * -- * The languages that may be associated to fields include -+ * The languages that may be associated with fields include - * LANGUAGE_NOT_SPECIFIED. +- * Process the given language code suggestion based on the available language +- * codes. ++ * Process the language code suggestion based on the available language codes. * - * @return -@@ -195,8 +195,8 @@ function field_is_translatable($entity_type, $field) { + * If a non-empty language code suggestion is provided it must appear among the + * available language codes, otherwise it will be ignored. +@@ -196,8 +201,8 @@ function field_is_translatable($entity_type, $field) { /** * Checks if a module is registered as a translation handler for a given entity. * @@ -3356,26 +3445,40 @@ index a4f5f8f..f199726 100644 * * @param $entity_type * The type of the entity whose fields are to be translated. -@@ -254,31 +254,30 @@ function field_valid_language($langcode, $default = TRUE) { - * Returns the display language for the fields attached to the given entity. +@@ -239,6 +244,7 @@ function field_has_translation_handler($entity_type, $handler = NULL) { + * @param $default + * Whether to return the default language code or the current language code in + * case $langcode is invalid. ++ * + * @return + * A valid language code. + */ +@@ -252,36 +258,34 @@ function field_valid_language($langcode, $default = TRUE) { + } + + /** +- * Returns the display language code for the fields attached to the given +- * entity. ++ * Returns the display language code for the fields of the given entity. * - * The actual language for each given field is determined based on the requested -- * language and the actual data available in the fields themselves. + * The actual language code for each given field is determined based on the + * requested language code and the actual data available in the fields +- * themselves. - * If there is no registered translation handler for the given entity type, the -- * display language to be used is just LANGUAGE_NOT_SPECIFIED, as no other +- * display language code to be used is just LANGUAGE_NOT_SPECIFIED, as no other - * language code is allowed by field_available_languages(). - * - * If translation handlers are found, we let modules provide alternative display -- * languages for fields not having the requested language available. +- * language codes for fields not having the requested language code available. - * Core language fallback rules are provided by locale_field_language_fallback() - * which is called by locale_field_language_alter(). -+ * language and the actual data available in the fields themselves. If there is -+ * no registered translation handler for the given entity type, the display -+ * language to be used is just LANGUAGE_NONE, as no other language code is -+ * allowed by field_available_languages(). If translation handlers are found, we -+ * let modules provide alternative display languages for fields not having the -+ * requested language available. Core language fallback rules are provided by -+ * locale_field_language_fallback(), which is called by ++ * themselves. If there is no registered translation handler for the given ++ * entity type, the display language code to be used is just ++ * LANGUAGE_NOT_SPECIFIED, as no other language code is allowed by ++ * field_available_languages(). If translation handlers are found, we let ++ * modules provide alternative display language codes for fields not having the ++ * requested language code available. Core language fallback rules are provided ++ * by locale_field_language_fallback(), which is called by + * locale_field_language_alter(). * * @param $entity_type @@ -3384,11 +3487,10 @@ index a4f5f8f..f199726 100644 * The entity to be displayed. * @param $field_name - * (optional) The name of the field to be displayed. Defaults to NULL. If -- * no value is specified, the display languages for every field attached to -- * the given entity will be returned. +- * no value is specified, the display language codes for every field attached + * (optional) The name of the field to be displayed. Defaults to NULL. If no -+ * value is specified, the display languages for every field attached to the -+ * given entity will be returned. ++ * value is specified, the display language codes for every field attached + * to the given entity will be returned. * @param $langcode * (optional) The language code $entity has to be displayed in. Defaults to * NULL. If no value is given the current language will be used. @@ -3396,16 +3498,57 @@ index a4f5f8f..f199726 100644 * @return - * A language code if a field name is specified, an array of language codes - * keyed by field name otherwise. -+ * A language code if a field name is specified, otherwise an array of ++ * A language code if a field name is specified, otherwise an array of + * language codes keyed by field name. */ function field_language($entity_type, $entity, $field_name = NULL, $langcode = NULL) { - $display_languages = &drupal_static(__FUNCTION__, array()); + $display_langcodes = &drupal_static(__FUNCTION__, array()); +diff --git a/core/modules/field/modules/field_sql_storage/field_sql_storage.install b/core/modules/field/modules/field_sql_storage/field_sql_storage.install +index eac5292..2d32555 100644 +--- a/core/modules/field/modules/field_sql_storage/field_sql_storage.install ++++ b/core/modules/field/modules/field_sql_storage/field_sql_storage.install +@@ -2,7 +2,7 @@ + + /** + * @file +- * Install, update and uninstall functions for the field_sql_storage module. ++ * Install, update, and uninstall functions for the Field SQL Storage module. + */ + + /** +@@ -25,7 +25,7 @@ function field_sql_storage_schema() { + } + + /** +- * Utility function: write field data directly to SQL storage. ++ * Writes field data directly to SQL storage. + * + * @ingroup update-api-7.x-to-8.x + */ diff --git a/core/modules/field/modules/field_sql_storage/field_sql_storage.module b/core/modules/field/modules/field_sql_storage/field_sql_storage.module -index adc50bd..db0922a 100644 +index 14e5745..cf78929 100644 --- a/core/modules/field/modules/field_sql_storage/field_sql_storage.module +++ b/core/modules/field/modules/field_sql_storage/field_sql_storage.module -@@ -34,12 +34,13 @@ function field_sql_storage_field_storage_info() { +@@ -1,13 +1,14 @@ + field); +@@ -407,7 +405,7 @@ class FieldSqlStorageTestCase extends DrupalWebTestCase { + } + + /** +- * Test foreign key support. ++ * Tests for foreign key support. + */ + function testFieldSqlStorageForeignKeys() { + // Create a decimal field. +diff --git a/core/modules/field/modules/list/list.install b/core/modules/field/modules/list/list.install +index c86a219..cf7fc23 100644 +--- a/core/modules/field/modules/list/list.install ++++ b/core/modules/field/modules/list/list.install +@@ -2,7 +2,7 @@ + + /** + * @file +- * Install, update and uninstall functions for the list module. ++ * Install, update, and uninstall functions for the List module. + */ + + /** diff --git a/core/modules/field/modules/list/list.module b/core/modules/field/modules/list/list.module index c2bff2a..d851b8c 100644 --- a/core/modules/field/modules/list/list.module @@ -3624,8 +3863,34 @@ index c2bff2a..d851b8c 100644 * * @see list_options_list() */ +diff --git a/core/modules/field/modules/list/tests/list.test b/core/modules/field/modules/list/tests/list.test +index 988f6a3..3bd12db 100644 +--- a/core/modules/field/modules/list/tests/list.test ++++ b/core/modules/field/modules/list/tests/list.test +@@ -2,7 +2,7 @@ + + /** + * @file +- * Tests for list.module. ++ * Tests for the List module. + */ + + /** +diff --git a/core/modules/field/modules/number/number.install b/core/modules/field/modules/number/number.install +index 02c7a30..3c4ae7f 100644 +--- a/core/modules/field/modules/number/number.install ++++ b/core/modules/field/modules/number/number.install +@@ -2,7 +2,7 @@ + + /** + * @file +- * Install, update and uninstall functions for the number module. ++ * Install, update, and uninstall functions for the Number module. + */ + + /** diff --git a/core/modules/field/modules/number/number.module b/core/modules/field/modules/number/number.module -index d00c55f..ca59463 100644 +index 23725f5..6e451a3 100644 --- a/core/modules/field/modules/number/number.module +++ b/core/modules/field/modules/number/number.module @@ -129,8 +129,8 @@ function number_field_instance_settings_form($field, $instance) { @@ -3648,6 +3913,19 @@ index d00c55f..ca59463 100644 */ function number_field_widget_validate($element, &$form_state) { $field = field_widget_field($element, $form_state); +diff --git a/core/modules/field/modules/number/number.test b/core/modules/field/modules/number/number.test +index 4a4f05f..c45a708 100644 +--- a/core/modules/field/modules/number/number.test ++++ b/core/modules/field/modules/number/number.test +@@ -2,7 +2,7 @@ + + /** + * @file +- * Tests for number.module. ++ * Tests for the Number module. + */ + + /** diff --git a/core/modules/field/modules/options/options.api.php b/core/modules/field/modules/options/options.api.php index d1ac0db..306a8a3 100644 --- a/core/modules/field/modules/options/options.api.php @@ -3692,7 +3970,7 @@ index d1ac0db..306a8a3 100644 function hook_options_list($field, $instance) { // Sample structure. diff --git a/core/modules/field/modules/options/options.module b/core/modules/field/modules/options/options.module -index 04b88d8..b89acaa 100644 +index 04b88d8..ef72cfa 100644 --- a/core/modules/field/modules/options/options.module +++ b/core/modules/field/modules/options/options.module @@ -2,7 +2,9 @@ @@ -3762,11 +4040,14 @@ index 04b88d8..b89acaa 100644 */ function _options_get_options($field, $instance, $properties) { // Get the list of options. -@@ -260,6 +285,11 @@ function _options_get_options($field, $instance, $properties) { - * Sanitizes the options. +@@ -257,9 +282,12 @@ function _options_get_options($field, $instance, $properties) { + } + + /** +- * Sanitizes the options. ++ * Sanitizes the options recursively to support optgroups. * - * The function is recursive to support optgroups. -+ * +- * The function is recursive to support optgroups. + * @param $options + * The option array. + * @param $properties @@ -3774,7 +4055,7 @@ index 04b88d8..b89acaa 100644 */ function _options_prepare_options(&$options, $properties) { foreach ($options as $value => $label) { -@@ -280,6 +310,18 @@ function _options_prepare_options(&$options, $properties) { +@@ -280,6 +308,18 @@ function _options_prepare_options(&$options, $properties) { /** * Transforms stored field values into the format the widgets need. @@ -3793,7 +4074,7 @@ index 04b88d8..b89acaa 100644 */ function _options_storage_to_form($items, $options, $column, $properties) { $items_transposed = options_array_transpose($items); -@@ -296,6 +338,12 @@ function _options_storage_to_form($items, $options, $column, $properties) { +@@ -296,6 +336,12 @@ function _options_storage_to_form($items, $options, $column, $properties) { /** * Transforms submitted form values into field storage format. @@ -3806,7 +4087,7 @@ index 04b88d8..b89acaa 100644 */ function _options_form_to_storage($element) { $values = array_values((array) $element['#value']); -@@ -327,13 +375,14 @@ function _options_form_to_storage($element) { +@@ -327,13 +373,14 @@ function _options_form_to_storage($element) { /** * Manipulates a 2D array to reverse rows and columns. * @@ -3826,7 +4107,7 @@ index 04b88d8..b89acaa 100644 * @return * The transposed array. */ -@@ -385,9 +434,10 @@ function options_field_widget_error($element, $error, $form, &$form_state) { +@@ -385,9 +432,10 @@ function options_field_widget_error($element, $error, $form, &$form_state) { } /** @@ -3839,8 +4120,36 @@ index 04b88d8..b89acaa 100644 * * @param $variables * An associative array containing: +diff --git a/core/modules/field/modules/options/options.test b/core/modules/field/modules/options/options.test +index b945949..1f765f3 100644 +--- a/core/modules/field/modules/options/options.test ++++ b/core/modules/field/modules/options/options.test +@@ -1,8 +1,8 @@ + $entity->ftid, '@ftvid' => $entity->ftvid)), PASS_THROUGH); +@@ -375,14 +375,14 @@ function field_test_entity_form($form, &$form_state, $entity, $add = FALSE) { + } + + /** +- * Validate handler for field_test_entity_form(). ++ * Form validation handler for field_test_entity_form(). + */ + function field_test_entity_form_validate($form, &$form_state) { + entity_form_field_validate('test_entity', $form, $form_state); + } + + /** +- * Submit handler for field_test_entity_form(). ++ * Form submission handler for field_test_entity_form(). + */ + function field_test_entity_form_submit($form, &$form_state) { + $entity = field_test_entity_form_submit_build_test_entity($form, $form_state); +@@ -450,7 +450,7 @@ function field_test_entity_nested_form($form, &$form_state, $entity_1, $entity_2 + } + + /** +- * Validate handler for field_test_entity_nested_form(). ++ * Form validation handler for field_test_entity_nested_form(). + */ + function field_test_entity_nested_form_validate($form, &$form_state) { + $entity_1 = (object) $form_state['values']; +@@ -461,7 +461,7 @@ function field_test_entity_nested_form_validate($form, &$form_state) { + } + + /** +- * Submit handler for field_test_entity_nested_form(). ++ * Form submission handler for field_test_entity_nested_form(). + */ + function field_test_entity_nested_form_submit($form, &$form_state) { + $entity_1 = (object) $form_state['values']; +diff --git a/core/modules/field/tests/field_test.field.inc b/core/modules/field/tests/field_test.field.inc +index cc76a99..e0dc853 100644 +--- a/core/modules/field/tests/field_test.field.inc ++++ b/core/modules/field/tests/field_test.field.inc +@@ -2,7 +2,7 @@ + + /** + * @file +- * Defines a field type and its formatters and widgets. ++ * Defines a field type, and its formatters and widgets. + */ + + /** +diff --git a/core/modules/field/tests/field_test.install b/core/modules/field/tests/field_test.install +index 5957561..f9c9321 100644 +--- a/core/modules/field/tests/field_test.install ++++ b/core/modules/field/tests/field_test.install +@@ -2,7 +2,7 @@ + + /** + * @file +- * Install, update and uninstall functions for the field_test module. ++ * Install, update, and uninstall functions for the field_test module. + */ + + /** +diff --git a/core/modules/field/tests/field_test.module b/core/modules/field/tests/field_test.module +index 90e25c8..02d49a8 100644 +--- a/core/modules/field/tests/field_test.module ++++ b/core/modules/field/tests/field_test.module +@@ -123,18 +123,16 @@ function field_test_field_language_alter(&$display_langcode, $context) { + /** + * Store and retrieve keyed data for later verification by unit tests. + * +- * This function is a simple in-memory key-value store with the +- * distinction that it stores all values for a given key instead of +- * just the most recently set value. field_test module hooks call +- * this function to record their arguments, keyed by hook name. The +- * unit tests later call this function to verify that the correct +- * hooks were called and were passed the correct arguments. ++ * This function is a simple in-memory key-value store with the distinction that ++ * it stores all values for a given key instead of just the most recently set ++ * value. field_test module hooks call this function to record their arguments, ++ * keyed by hook name. The unit tests later call this function to verify that ++ * the correct hooks were called and were passed the correct arguments. + * +- * This function ignores all calls until the first time it is called +- * with $key of NULL. Each time it is called with $key of NULL, it +- * erases all previously stored data from its internal cache, but also +- * returns the previously stored data to the caller. A typical usage +- * scenario is: ++ * This function ignores all calls until the first time it is called with $key ++ * of NULL. Each time it is called with $key of NULL, it erases all previously ++ * stored data from its internal cache, but also returns the previously stored ++ * data to the caller. A typical usage scenario is: + * + * @code + * // calls to field_test_memorize() here are ignored +@@ -158,8 +156,8 @@ function field_test_field_language_alter(&$display_langcode, $context) { + * @param $value + * A value to store for $key. + * @return +- * An array mapping each $key to an array of each $value passed in +- * for that key. ++ * An array mapping each $key to an array of each $value passed in for that ++ * key. + */ + function field_test_memorize($key = NULL, $value = NULL) { + $memorize = &drupal_static(__FUNCTION__, NULL); +diff --git a/core/modules/field/tests/field_test.storage.inc b/core/modules/field/tests/field_test.storage.inc +index eaa0851..49b1b32 100644 +--- a/core/modules/field/tests/field_test.storage.inc ++++ b/core/modules/field/tests/field_test.storage.inc +@@ -66,7 +66,7 @@ function field_test_field_storage_details_alter(&$details, $field) { + } + + /** +- * Helper function: stores or retrieves data from the 'storage backend'. ++ * Helper function: Stores or retrieves data from the 'storage backend'. + */ + function _field_test_storage_data($data = NULL) { + if (!isset($data)) { diff --git a/core/modules/field/theme/field.tpl.php b/core/modules/field/theme/field.tpl.php index a6d7a96..5c6f5a2 100644 --- a/core/modules/field/theme/field.tpl.php