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

Please help :)

Comments

harcher’s picture

Attached is the flags setup page

quicksketch’s picture

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.

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new2.33 KB

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.

Status: Fixed » Closed (fixed)

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