Updated: Comment #N
Problem/Motivation
In Drupal 7 entities and their properties could be exposed to the token API automatically through entity_token, a sub module of the contributed Entity module. Most of the module has been merged with Drupal core, but there is no automatic exposure to token API yet.
Proposed resolution
Make the System module expose typed data in hook_token_info()
, and perform replacements in system_tokens()
.
Remaining tasks
- #2002134: Move TypedData metadata introspection from data objects to definition objects will allow us to retrieve typed data property definitions without needing data instances.
- #2002254: Add support for typed data selection will help us get the typed data values using token selectors.
- #2163027: Type token returns in a typed data recognizable format is a preparatory issue that makes sure existing token definitions are compatible with typed data IDs.
- Introduce a new “typed_data” (bool) property to token definitions.
- Update System module's token hook implementations. It will perform access control and return the replacement value (which implements
TypedDataInterface
) itsgetValue()
return value.Token::replace()
must accept anAccountInterface
object for runtime access control.
User interface changes
None.
API changes
None.