This is a follow-up from #712060: Allow tokens in the redirect URL field.

Now that we have tokens on the redirect URL, we have an obvious need for the following tokens:

%nid
%sid
%uid

Comments

quicksketch’s picture

Merging in #1153496: Create tokens for %uid, %sid, and %nid. Improve token help., since we can easily add %title if we're adding %nid.

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new9.45 KB
new8.43 KB

Well adding the tokens was a piece of cake but our help text really needed some work around tokens. This patch rewrites the theme_webform_token_help() and adds the %uid, %sid, and %nid tokens, as well as fixing a few places where tokens are allowed in D7.

quicksketch’s picture

Title: Create tokens for %uid, %sid, and %nid » Create tokens for %uid, %sid, and %nid. Improve token help.
jasom’s picture

Version: 7.x-3.x-dev » 6.x-3.11
Category: feature » bug
Status: Fixed » Active
Issue tags: +token, +nid, +%nid

Token %nid is not working for my webform. This is description of text component which is using all available tokens:


 admin - The name of the user if logged in. Blank for anonymous users.
 mail@gmail.net - The e-mail address of the user if logged in. Blank for anonymous users.
 127.0.0.1 - The IP address of the user.
 127.0.0.1 - The name of the site (i.e. 127.0.0.1)
 Wednesday, May 25, 2011 - 10:00 - The current date, formatted according to the site settings.

 %nid - The node ID.
 %title - The node title.

 - Any user profile field or value, such as majitel or
 - Tokens may be populated from the URL by creating URLs of the form http://example.com/my-form?foo=bar. Using the token would print "bar".

As you can see node ID and title tokens don't work. When is hidden component set to %nid token, on submission results it records just %nid.

achton’s picture

I would be inclined to add (select parts of) the user object, so one could do things like %user[roles] and similar stuff. Is that a bad idea?

quicksketch’s picture

Version: 6.x-3.11 » 7.x-3.11
Category: bug » feature
Status: Active » Fixed

Hi guys, please keep feature requests closed as feature requests and file new issues for bugs or new feature requests.

Status: Fixed » Closed (fixed)

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

jasom’s picture

Hi quicksketch, i didnt understand you at #6.

achton’s picture

jasom: that was certainly a response to both of our comments, which should (rightfully) be added as seperate issues.

I moved mine to #1169432: Add tokens for $user object. Yours seems to be a new bug, which is unrelated to the implementation of this feature, so should also go into a new issue.

avpaderno’s picture

Issue summary: View changes
Issue tags: -token, -nid, -%nid

I am removing issue tags used from one to four issues.