We have a content type with a term reference field that is hidden on page display, and while working with the Metatags module I noticed that tokens referencing fields that are hidden on the page display type were not being populated, and in fact were generating errors in the taxonomy field module. If I made the field visible in the display type, it worked fine.
Further investigation through the call stack found that the entity being used was already processed for the current page display type (in which the hidden fields were not fully processed), and when subsequent field format calls were made on the entity's fields, no hook_field_formatter_prepare_view hooks were being invoked on the fields due to $entity->_field_view_prepared being set to TRUE on the cloned entity.
This patch resets that flag on the cloned entity prior to running through the field rendering code, allowing all fields to be rendered on the entity for the "token" display type, resulting in all field tokens being processed fully and available for use.
PASSED: [[SimpleTest]]: [MySQL] 307 pass(es).
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch token-7.x-1.0-rc1-field_view_prepared_reset-1508404.patch. Unable to apply patch. See the log in the details link for more information.
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in token-7.x-1.0-rc1-field_view_prepared_reset_0.patch.
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in token-7.x-1.0-rc1-field_view_prepared_reset.patch.