Problem/Motivation

See #2449457-41: inconsistent checks in content_translation (comments 41 through 49). The hook_entity_alter() build docs say:

Do not use this hook to add information to entity types, unless you are just filling-in default values. Use hook_entity_type_build() instead.

That is incomplete information, however, since there are other circumstances where hook_entity_type_build() will not work as expected.

Proposed resolution

Expand the docs. Attached patch tries to clarify.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Unfrozen changes Unfrozen because it only changes documentation.

Remaining tasks

This could use some review for technical accuracy.

User interface changes

N/A

API changes

N/A

Comments

Status: Needs review » Needs work

The last submitted patch, hook_entity_type_build.patch, failed testing.

xjm’s picture

Status: Needs work » Needs review
StatusFileSize
new1.78 KB

Oops. Now without nonsense hunks from another interdiff.

jhodgdon’s picture

Status: Needs review » Needs work

Looks good!

Nitpick: list formatting. We normally end list items in . not , and do not put "or" in them as in this patch.

So I would suggest the line before the list say "... unless one of the following is true:", and then take out the , and or stuff.

Also each list item normally starts with a capital letter.

jacobsanford’s picture

Status: Needs work » Needs review
StatusFileSize
new1.81 KB
new1.08 KB

Changes requested in #3 implemented.

I also removed the word 'just' from the first list item - it seemed redundant.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, that looks fine to me.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 5a54339 and pushed to 8.0.x. Thanks!

  • alexpott committed 5a54339 on 8.0.x
    Issue #2478855 by xjm, JacobSanford, jhodgdon: Improve documentation for...

Status: Fixed » Closed (fixed)

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