In field_permission_example.module the field_permission_example_entity_field_access function is checking for the correct field name using $field_definition->getType(), which returns the field type. I believe the getName() method should be used instead to return the field name on line 99.

Comments

jascote created an issue. See original summary.

michaellenahan’s picture

Status: Active » Closed (works as designed)

Actually, it's correct as it is. The code in field_permission_example_entity_field_access() should only run when the type of field is a fieldnote. We don't actually care about what the name of the field is.