From 4798dcf395b614786b68009b60b9ffa660e8cb5c Mon Sep 17 00:00:00 2001 From: Jennifer Hodgdon Date: Fri, 14 Jun 2013 05:51:15 -0700 Subject: [PATCH] Issue #2009092 by smiletr: Fix up documentation for field_attach_view(), which was inaccurate for D8 --- core/modules/field/field.attach.inc | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/core/modules/field/field.attach.inc b/core/modules/field/field.attach.inc index baa7ff47909c..76fe855bd6de 100644 --- a/core/modules/field/field.attach.inc +++ b/core/modules/field/field.attach.inc @@ -1410,7 +1410,7 @@ function field_attach_prepare_view($entity_type, array $entities, array $display * Returns a renderable array for the fields on an entity. * * Each field is displayed according to the display options specified in the - * instance definition for the given view mode. + * $display parameter for the given view mode. * * field_attach_prepare_view() and field_attach_view() are two halves of the * same operation. It is safe to call field_attach_prepare_view() multiple times @@ -1418,28 +1418,7 @@ function field_attach_prepare_view($entity_type, array $entities, array $display * Field API operation on an entity between passing that entity to these two * functions may yield incorrect results. * - * Sample structure: - * @code - * array( - * 'field_foo' => array( - * '#theme' => 'field', - * '#title' => the label of the field instance, - * '#label_display' => the label display mode, - * '#object' => the fieldable entity being displayed, - * '#entity_type' => the type of the entity being displayed, - * '#language' => the language of the field values being displayed, - * '#view_mode' => the view mode, - * '#field_name' => the name of the field, - * '#field_type' => the type of the field, - * '#formatter' => the name of the formatter, - * '#items' => the field values being displayed, - * // The element's children are the formatted values returned by - * // hook_field_formatter_view(). - * ), - * ); - * @endcode - * - * @param Drupal\Core\Entity\EntityInterface $entity + * @param \Drupal\Core\Entity\EntityInterface $entity * The entity with fields to render. * @param \Drupal\entity\Plugin\Core\Entity\EntityDisplay $display * The entity display object. @@ -1448,7 +1427,7 @@ function field_attach_prepare_view($entity_type, array $entities, array $display * provided the current language is used. * @param array $options * An associative array of additional options. See field_invoke_method() for - * details. + * details. Note: key "langcode" will be overridden inside this function. * * @return array * A renderable array for the field values.