Flag Node Token replacement Not Working on Node edit page

hga77 - October 26, 2009 - 18:43
Project:Flag
Version:6.x-2.x-dev
Component:Flag core
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Token replacement on form for adding node doesnt work (look at attached image), but works on form for editing node.

Please help :)

AttachmentSize
token-not-working.jpg24.78 KB

#1

hga77 - October 26, 2009 - 18:46

Attached is the flags setup page

AttachmentSize
Edit Featured flag - momentumww uk_1256582725462.png 109.31 KB

#2

quicksketch - October 26, 2009 - 21:21
Title:Flag Token replacement Not Working» Flag Node Token replacement Not Working on Node edit page
Priority:critical» normal

I believe tokens work everywhere except the node-edit page. This is because there isn't yet a $node object to replace tokens on (for example [title] clearly wouldn't work in your screenshot, since there isn't even a title entered into the field yet). However I think it should be able to replace something like [type-name] at least, since the type is known on a node/add/[type] page.

#3

quicksketch - November 3, 2009 - 03:08
Status:active» fixed

I've committed this patch which allows nodes a special exception when replacing tokens. Instead of requiring a NID, the token replacement for nodes is now extended to allow a node-type also. In the case that a node-type is used, a pseudo-node is created for token purposes.

I've ran into this exact same problem a couple times, so I think this exception is worth including.

AttachmentSize
flag_new_node_tokens.patch 2.33 KB

#4

System Message - November 17, 2009 - 03:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.