2nd parameter disagrees:

/**
 * Builds a renderable array for field values.
 *
 * @param $entity_type
 *   The type of $entity; e.g. 'node' or 'user'.
 * @param $entities
 *   An array of entities being displayed, keyed by entity id.
// SNIP
function field_default_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {

$entity or $entities?
$instance or $instances?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

WTF indeed.

The function definition is correct (of course), and the PHPdoc needs to be fixed.
$entity
The entity being displayed.
$instance
The instance structure for $field on $entity's bundle.

(that's if we want to be consistent with rest of the PHPdocs in field.default.inc)

Care to roll a patch ? ;-)

joachim’s picture

Issue tags: +Novice

Thanks for the info :)

I haven't time over the next few days, so tagging as novice in case someone at a sprint wants to pick it up.

nanotube’s picture

Status: Active » Needs review
Issue tags: -Novice
FileSize
840 bytes

Patch for documentation update.

joachim’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

Patch looks good to me.

rfay’s picture

Version: 7.x-dev » 8.x-dev
Status: Reviewed & tested by the community » Needs review

D8 first. Let's get these fixed on D8 and into D7.

joachim’s picture

Status: Needs review » Reviewed & tested by the community

This is surely still RTBC on 8.

rfay’s picture

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1088930-field_default_view-documentation.patch, failed testing.

joachim’s picture

Oh it probably needs a post-apocalypse reroll...

nanotube’s picture

Status: Needs work » Needs review
FileSize
1.12 KB

Rerolled for post-apocalypse event. Documentation fix already in the most current commit. Apply patch only if we want to be consistent with rest of the PHPdocs in field.default.inc.

kscheirer’s picture

#10: documentation-1088930-10.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, documentation-1088930-10.patch, failed testing.

swentel’s picture

Version: 8.x-dev » 7.x-dev

This function doesn't exist anymore in D8, moving to D7.

stefan.r’s picture

Issue summary: View changes
Issue tags: +Novice, +Dublin2016

Tagging the D7 task as Novice

girijap’s picture

Made the corrections in the paramters definition section.
Attached patch file with the changes

chiranjeeb2410’s picture

@girijap,

Patch name should be appropriate and not too long. Also, your patch isn't getting tested.
Try to create interdiffs, makes the reviewing process way easier.

kscheirer’s picture

Status: Needs work » Needs review

I think this is the first patch for D7, so no interdiff needed. Setting issue to "needs review" so testbot will find it.

Status: Needs review » Needs work

The last submitted patch, 16: [drupal-core]-[documentation-problem]-[1088930]-[#16].patch, failed testing.

c.nish2k3’s picture

  * @param $entity
 *   A single object of type $entity_type.
 * @param $field
 *   The field structure for the operation.
 * @param $instance
 *   An array containing each field on $entity's bundle.
//SNIP
function field_default_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {

The doc currently says $entity and $instance and hence this issue is no longer valid. I guess this can be closed.

c.nish2k3’s picture

Status: Needs work » Closed (outdated)