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.
I have a content type that uses three taxonomy terms as the title via tokens.
When I create a node the title will show raw token and not the value.
When I re-edit the node and save, the value will be inserted.
Which tokens and how many show raw tokens seems to be totally random.
There are two screenshots.
The first is the nodes initial creation.
The second is after re-saving the node.
Strange.
Comment | File | Size | Author |
---|---|---|---|
#14 | auto_nodetitle-shows-token-on-node-insert-1212234-14.patch | 504 bytes | kaidjohnson |
#10 | Node_title_shows_token_on_initial_creation-change_to_use_hook_node_insert-8182657-9.patch | 617 bytes | rlangille |
NodeTitleReSave.JPG | 24.16 KB | MrPhilbert | |
NodeTitleCreation.JPG | 23.73 KB | MrPhilbert |
Comments
Comment #1
JustMagicMaria CreditAttribution: JustMagicMaria commentedSubscribing. Same issue.
Comment #2
Waen CreditAttribution: Waen commentedSuscribing.
I have the same annoying problem!
Comment #3
jfrederick CreditAttribution: jfrederick commentedSubscribing.
Re-saving the node also replaces the tokens for me.
Comment #4
gagoo CreditAttribution: gagoo commentedSame problem except that it doesn't replace tokens after re-saving.
Subscribe
Comment #5
muhh CreditAttribution: muhh commentedi can confirm this and add the following: it looks like it happens only with tokens, that are generated with the node, like [node:nid], but not with existing values, like [site:current-user].
Comment #6
phelix CreditAttribution: phelix commentedThis is happening to me too. After a edit and save again it displays just fine. Someone please help me figure out whats causing this!!
Comment #7
thoughtcat CreditAttribution: thoughtcat commentedSame problem here :(Edit: This is a really old issue (years old) although someone has posted some workarounds at http://drupal.org/node/373978#comment-5464000
I fixed this easily using Rules - instructions here: http://drupal.org/node/373978#comment-1654702
Thanks to users dreeds for the instructions and aubjr_drupal for linking to them from his comment at http://drupal.org/node/373978#comment-5464000
:-))
Comment #8
caw67 CreditAttribution: caw67 commentedsame problem here. and it is no solution to use rules!! i know it works, but wether i use rules i dont need the automatic_nodetitle module!
and same problem in auto_entitylabel
Comment #9
rlangille CreditAttribution: rlangille commentedHow about instead of using rules to create a band-aid for an annoying issue, we just use hook_node_insert. The node is fully populated, but not yet committed to the db (even has node id). If you look at the documentation for the hook you'll see that you can do something as simple as the following to resolve the issue...
This will change the node title before it's initially committed to the db, since node_save has not yet gone out of scope, but the entire transaction is fully formed.
Patch coming shortly.
Comment #10
rlangille CreditAttribution: rlangille commentedComment #11
rlangille CreditAttribution: rlangille commentedComment #12
jfrederick CreditAttribution: jfrederick commentedComment #13
jfrederick CreditAttribution: jfrederick commentedComment #14
kaidjohnson CreditAttribution: kaidjohnson commentedRe-rolled for coding standards. No functional change.
+1 RTBC
Comment #15
rlangille CreditAttribution: rlangille commentedWoops, forgot to run my script to convert the standards. Thanks for the catch! :D
Comment #16
manish-31 CreditAttribution: manish-31 at OpenSense Labs for DrupalFit commentedThe module is working fine the title for a node is correctly generated. I've tested all cases default , using tokens and with php every time correct title is being generated while creating a node. This issue should be closed or fixed as it no longer exists.
Comment #17
gaurav.kapoor CreditAttribution: gaurav.kapoor commented