Problem/Motivation

The token source is defining a "context_mapping" in settings form, is it really necessary?

also, we need to check that token source actually works properly in the different drupal plugins implemented.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

just_like_good_vibes created an issue. See original summary.

christian.wiedemann’s picture

christian.wiedemann’s picture

Sorry did not read the other issue first. Fine you can merge.

just_like_good_vibes’s picture

I will make a little round of UI tests with token in different contexts and plugins, and then merge :)
i don't know well this plugin.. good occasion

just_like_good_vibes’s picture

hello,
for me the code for token is probably not totally ok.
For example it may not handle properly EntityTypeMappings (where for example a taxonomy_term is usually refered as term). this is not the case in our code.

We may have add code compatible with token module only when enabled thanks to module handler service.
in that particular case, we could optionally call the usual token validation function and add the dependency to token module in the source calculateDependencies

just_like_good_vibes’s picture

just_like_good_vibes’s picture

Assigned: just_like_good_vibes » Unassigned
Status: Active » Needs review

Hello,
this is what i found :
some tokens may return complex markup (being actually result of a render arrays... ) like entity fields for exemple.
to support those token values, we cannot really declare them in a source with prop_type "string". Token source is like that ...

Therefore, i have introduced a new source token_plain which really render plain text from a token (tagged with prop_type string and still convertible to a slot, but it is a plain text value).
The existing Token source is now tagged compatible with a slot, and it can return markup :)

I find this is a real improvement from the previous situation.

Also, as mentioned in a previous comment, i added some tests about the presence of token module.
when available, it is used. when unavailable, no problem and token type keys are the same, especially for specific cases like taxonomy vocabulary and terms.

Please review.

pdureau’s picture

just_like_good_vibes’s picture

Status: Needs review » Fixed
pdureau’s picture

Status: Fixed » Closed (fixed)
christian.wiedemann’s picture