I have a module that implements hook_field_access(). For some (but not all) of a content type's fields, the $node object passed to the hook is empty. This was not the case in 2.6; I believe it may be a new issue in 2.8. The result is that my module no longer works (since it needs to use the node id).

Comments

xjm’s picture

Status: Closed (works as designed) » Active

Upon further investigation, it appears that the hook is invoked multiple times for each field--twice for most, and dozens of times for some. In the later invocations, the node id is empty.

I confirmed that the $node object is empty in content_access() at these points as well, although it is called only once for every two times my hook is invoked.

xjm’s picture

Component: Content Permissions module » content.module
Status: Active » Closed (works as designed)

Turns out the actual problem was being caused by a change in the filefield module: #833054: argument 2 for filefield_view_access() revisited. All the other empty $node objects were noise from the menu system.

xjm’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)