Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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).
Comment | File | Size | Author |
---|---|---|---|
#2 | token-n2150879-2.patch | 1.13 KB | DamienMcKenna |
#1 | 2150879-token-more-view-modes-and-cowbell.patch | 698 bytes | Dave Reid |
Comments
Comment #1
Dave ReidThis should do the trick.
Comment #2
DamienMcKennaI'd put together this little ditty.
Comment #3
DamienMcKennaYour one is shorter, but I suggest updating the comment too.
Comment #4
DamienMcKennaThe 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.
Comment #5
noslokire CreditAttribution: noslokire commentedBoth worked for us, disaster averted. Sticking with #2, although I prefer the patch name in #1.
Comment #6
Dave ReidCommitted #2 to 7.x-1.x. Thanks!
http://drupalcode.org/project/token.git/commit/379cb7d