API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...

> $items: (optional) The entity field object on which the operation is to be performed.

When is this parameter not given?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

Berdir’s picture

When the caller doesn't have $items/an entity. A common example is views checking access to display a table column or not.

Not sure what you want to deprecate, anyone could call it for whatever reason. If you want to document something then what it means, not when it happens.

joachim’s picture

Issue tags: +Novice

> Not sure what you want to deprecate, anyone could call it for whatever reason. If you want to document something then what it means, not when it happens.

I'm not suggesting we deprecate anything.

And what I mean is that we should document under what circumstances $items is not given.

It looks like the documentation from https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21... could be copied here.

msankhala’s picture

msankhala’s picture

Status: Active » Needs review
joachim’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the patch!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 2a7952f2bf to 8.6.x and e9be40977d to 8.5.x. Thanks!

Backported to 8.5.x as this is a docs change only.

Credited @joachim for creating the issue and reviewing.

  • alexpott committed 2a7952f on 8.6.x
    Issue #2958744 by msankhala, joachim: hook_entity_field_access() should...

  • alexpott committed e9be409 on 8.5.x
    Issue #2958744 by msankhala, joachim: hook_entity_field_access() should...

Status: Fixed » Closed (fixed)

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

Wim Leers’s picture