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.
Problem/Motivation
#731724: Convert comment settings into a field to make them work with CMI and non-node entities Will decouple comments from nodes. Support for comment tokens relating to nodes will be retained in D8 for BC but can be removed in D9. This is the issue to remove them.
Proposed resolution
Remove support for node tokens in comment.tokens.inc
Remaining tasks
Write patch, review.
User interface changes
None
API changes
Node tokens no longer supported for comments.
Related Issues
#731724: Convert comment settings into a field to make them work with CMI and non-node entities
Comment | File | Size | Author |
---|---|---|---|
#11 | 2031901-node-tokens-11.patch | 5.38 KB | andypost |
Comments
Comment #1
larowlanWhoops
Comment #2
catchThis seems like we'll run into it whichever version they're taken out of. Given migrate and that specific tokens aren't much of an API, moving back to 8.x at least for now.
Comment #3
andypostLet's see a test coverage.
This [node] tokens could be provided by deprecated contrib module
Comment #5
andypostFixed patch - added test for tokens that replaces current functionality
CR https://www.drupal.org/node/2371365
Comment #6
larowlanShouldn't this be id, not nid?
Comment #7
andypostNO,
:id
would work only for entities that have ID as key, that's why I extended a testComment #8
andypostComment #9
larowlanah, makes sense - thanks!
Comment #11
andypostre-roll
Comment #12
larowlanback we go
Comment #13
catchThese test changes look odd to me, why would we still test comment:entity:nid or comment:entity:title and support that?
Comment #14
andypostI've added this tests because there's no coverage for [comment:entity:*] tokens and to make sure that removed functionality works by the new way
Comment #15
catchWhy nid and title rather than id and label though?
Comment #16
andypostin #7 I said that there's no such tokens - each token is Real entity field (name)
PS: filed new issue #2372465: Add unified entity tokens for ID and Label
Comment #17
catchExplanation and follow-up both good.
Committed/pushed to 8.0.x, thanks!