Currently the Token module only adds the new Token view mode if the 'view modes' array item exists in the entity's definition. It should, instead, check to verify that the entity is fieldable, that way it can support entity types that don't include any custom view modes out of the box, e.g. Multifield (#2123435: Support the Tokens view mode).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Status: Active » Needs review
FileSize
698 bytes

This should do the trick.

DamienMcKenna’s picture

FileSize
1.13 KB

I'd put together this little ditty.

DamienMcKenna’s picture

Your one is shorter, but I suggest updating the comment too.

DamienMcKenna’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #1 does indeed make it so that the Token display settings can be customized on the Multifield module, which is the exact use case we were trying to catch.

noslokire’s picture

Both worked for us, disaster averted. Sticking with #2, although I prefer the patch name in #1.

Dave Reid’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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