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.
Tokens like [node:title] still use $node->title and not $node->label(), and [node:url] still generates the link manually from "node/" . $node->nid rather than using $node->uri(). This should have been caught in the individual entity conversions but it wasn't, so we should fix them all now.
This should be backported to Drupal 7 to use entity_label() and entity_uri() in tokens.
Comment | File | Size | Author |
---|---|---|---|
#26 | drupal_1764358_26.patch | 13.69 KB | Xano |
Comments
Comment #1
larowlanWill help if you need, if so assign to me
Comment #2
larowlanWIP, ran out of time to track down what is causing the test fails
Fixes for user and node entities.
Comment #4
larowlan#2: core-tokens-1764358.2.patch queued for re-testing.
Comment #6
Xano#2: core-tokens-1764358.2.patch queued for re-testing.
Comment #8
XanoRe-roll.
Comment #10
XanoThe patch makes sure all core entity (user, comment, node, term, vocabulary, file) tokens use the id(), label(), and uri() methods instead of the corresponding properties.
Comment #12
XanoApparently $_GLOBALS['user'] is not a user entity yet.
Comment #13
XanoI was under the impression that global $user was a full user object, but this is not the case (for good reason).
Re-rolling the patch without the line that changed the last test fail.
Comment #14
XanoComment #15
Xano#13: drupal_1764358_05.patch queued for re-testing.
Comment #17
Xano13: drupal_1764358_05.patch queued for re-testing.
Comment #19
XanoRe-roll.
Comment #21
XanoComment #23
Xano21: drupal_1764358_21.patch queued for re-testing.
Comment #24
Xano21: drupal_1764358_21.patch queued for re-testing.
Comment #26
XanoComment #36
catchDrupal 8/9 uses the correct entity methods now, moving back to 7.x