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.
Hello...
A "raw" title option for nodereference tokens is needed for proper use with Pathauto. (Otherwise punctuation is HTML encoded before Pathauto punctuation rules are applied).
Patch included for review..
Comment | File | Size | Author |
---|---|---|---|
#6 | cck-nodereference-raw-token-V3.patch | 1.49 KB | Moonshine |
#3 | cck-nodereference-raw-token-V2.patch | 1.38 KB | Moonshine |
cck-nodereference-raw-token.patch | 1.54 KB | Moonshine |
Comments
Comment #1
Woodside CreditAttribution: Woodside commentedWorks well for me, thanks!
Comment #2
yched CreditAttribution: yched commentedProblem with these kind of tokens is that they add a node_load for each token replacement, even if that specific token is not involved...
Comment #3
Moonshine CreditAttribution: Moonshine commentedAhh! I was assuming the node was already loaded & cached from the building of $item['view']. Instead it looks like another function is used _nodereference_titles() and it has it's own static cache. :)
I think this should do the trick... It's just really helpful for building out nice parented path aliases.
Comment #4
Moonshine CreditAttribution: Moonshine commentedActually should this check isset($item['view']) instead ? Then no query would be run that hasn't already been run for $item['view'] as least. Or perhaps that doesn't matter in the end, as $item['view'] will always be there if there is a nid..
Comment #5
yched CreditAttribution: yched commentedSmart. Since we render the node to get its tokens, the query will have happened anyway and we don't repeat it (at least if the noderef formatter uses _nodereference_titles(), which is the case of all default formatters).
Should we then also have :
Comment #6
Moonshine CreditAttribution: Moonshine commentedSure... added.. :)
Comment #7
yched CreditAttribution: yched commentedYou replaced the wrong token ;-)
Fixed and committed. Thanks !
Comment #8
yched CreditAttribution: yched commentedForgot to add : I left the sting fixes out for now - we're 'trying' to be in string freeze mode...
Comment #9
Moonshine CreditAttribution: Moonshine commentedwow.. SORRY :/ I moved too quick. Thanks though!
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.