Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 299069

Automatically expose typed data to token API

$
0
0

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

  1. #2002134: Move TypedData metadata introspection from data objects to definition objects will allow us to retrieve typed data property definitions without needing data instances.
  2. #2002254: Add support for typed data selection will help us get the typed data values using token selectors.
  3. #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.
  4. Introduce a new “typed_data” (bool) property to token definitions.
  5. Update System module's token hook implementations. It will perform access control and return the replacement value (which implements TypedDataInterface) its getValue() return value. Token::replace() must accept an AccountInterface object for runtime access control.

User interface changes

None.

API changes

None.


Viewing all articles
Browse latest Browse all 299069

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>