API page: http://api.drupal.org/api/drupal/modules--field--field.default.inc/funct...

Describe the problem you have found:

Under the 'Parameters' section, $entities should be $entity as per actual function parameters.

Additionally, $instances should be $instance.

Comments

droplet’s picture

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

You right, can you send us a patch

jhodgdon’s picture

Title: Documentation problem with field_default_view » field_default_view doc has problems
Priority: Minor » Normal
Issue tags: +Needs backport to D7

It looks like $entity it only accepts a single entity rather than an array also -- it's not just the arg name that is wrong, but also the param description.

Same problem with the $instance parameter.

And the description says "field values" - perhaps that should be reworded to say it's only for one field on one entity instance?

jhodgdon’s picture

Issue tags: +Novice

Probably a good project for a novice doc contributor

James_Stallings’s picture

Assigned: Unassigned » James_Stallings
James_Stallings’s picture

Assigned: James_Stallings » Unassigned
Status: Active » Needs review
StatusFileSize
new1.08 KB
James_Stallings’s picture

While scanning through field.default.inc, I noticed a lot of documentation issues. I'll go ahead and file these.

droplet’s picture

Status: Needs review » Needs work

$instance is an array
$entity is an object

can we docs it ?

@James_Stallings,
can you fix it in same issue if there are similar errors.

James_Stallings’s picture

Status: Needs work » Needs review
StatusFileSize
new1.08 KB
jhodgdon’s picture

Status: Needs review » Needs work

This has some whitespace problems:

+ * @param $instance
+*   An array containing each $field on $entity's bundle.

And $field should just be "field" without the $ here, I think -- $field is referring to the field information, which isn't what $instance contains (it contains the field data).

Also, $items is not passed by reference in this function, so I think this change is wrong:

  * @param $items
- *   Array of field values already loaded for the entities, keyed by entity id.
+ *   The field values. This parameter is altered by reference to receive the
+ *   incoming form values.

Finally, I think this sentence should say "of type $entity_type":

+ * @param $entity
+ *   A single object of $entity_type.
James_Stallings’s picture

Status: Needs work » Needs review
StatusFileSize
new847 bytes
jhodgdon’s picture

Status: Needs review » Needs work

One other thing that needs fixing (see comment #2):
And the description says "field values" - perhaps that should be reworded to say it's only for one field on one entity instance?

The changes in the current patch look good -- I just think we need slightly more.

James_Stallings’s picture

Status: Needs work » Needs review
StatusFileSize
new973 bytes
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Excellent, thanks! d8/d7 please...

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x and 7.x. Thanks!

Thanks for your attention to the docs queue as well, James! :) Always nice to get an extra set of hands!

Automatically closed -- issue fixed for 2 weeks with no activity.