In `field_token_info_alter` it's checked whether there is a token type specified. If this is the case the fields are loaded and looped through. The first check in the loop is to see if there is any info set for the token type. If this is not the case then the field is skipped and the loop continues to the next field. Between one field and the next there's no way for the condition's result to change. It makes more sense to check this before loading any fields at all and just skip the entire loop.

Comments

Kingdutch created an issue. See original summary.

Kingdutch’s picture

Assigned: Kingdutch » Unassigned
Status: Active » Needs review
FileSize
776 bytes

Patch attached

Status: Needs review » Needs work
Kingdutch’s picture

I don't quite see how that test is related to the changes in the patch unless it relied on side effects of loading the fieldDefinitions.