- Merge request !3Issue #3227446: Remove message_token_info and let Token module define all tokens β (Open) created by mglaman
- First commit to issue fork.
- last update
10 months ago 30 pass, 2 fail - π³π±Netherlands eelkeblok Netherlands π³π±
I see that the tests change the used tokens from [message:author:name] to [message:uid:entity:name] and that the hook_token is completely removed. This looks like a BC-breaking change. I'm not sure, but maybe we can somehow keep them functional while also giving a deprecation warning (I think this may be possible by implementing the token in hook_token but not actually defining them, i.e. still leaving out hook_token_info.
- π³π±Netherlands eelkeblok Netherlands π³π±
Actually, why do we want to leave this to token module? It is not a dependency, and I am unsure whether we should want it to be. I am currently on a quest to get the variant values of messages to be available as tokens and thought this might do it, but no luck.
- π³π±Netherlands eelkeblok Netherlands π³π±
I wasn't entirely sure why this is happening. In case you are curious as well, this is where token module is deciding not to do any base field tokens when a module defines its own tokens: https://git.drupalcode.org/project/token/-/blob/8.x-1.x/token.tokens.inc... (Still not 100% in the clear why it does that, but there's probably a good reason).
In the spirit of DRY, I guess a lot is to be said for actually depending on token module.
- We'll need a dependency on token module in info.yml (and concencus this is what we want to do..?)
- Wel'll need an update hook to enable token module if it is not enabled
- We'll need to check which of our own tokens can be removed completely because they are now defined by token module
- We'll need to check which of our own tokens have equivalents in the default token implementation and deprecate them, presumably by issuing a deprecation warning when they are used
- π³π±Netherlands eelkeblok Netherlands π³π±
It is a quite a battle to get tests to work with the Token module. I am now running into the fact that Token module seems to be dependent on certain date formats being available.
As for the dependency, my current thinking is that maybe we should not "hard" require Token module. What that does imply is that we need to make it clear in release notes that if you need tokens derived from messages, you need to install the module.
- π³π±Netherlands eelkeblok Netherlands π³π±
It always helps to complain (?). I think this should take care of it.
- Status changed to Needs review
5 months ago 12:38pm 28 June 2024 - Status changed to RTBC
4 months ago 12:10am 23 July 2024 - π¬π·Greece vensires
Using your patch I personally didn't have any issues.
And thank you very much for your detailed updates though it was a solo effort! I really appreciated it!
Setting it as RTBC!