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'd like to generate a random code to use as field, so I can storage it with the other values of the webform.
Is there a way to do this?
Comments
Comment #1
DanChadwick CreditAttribution: DanChadwick commentedAs requested by the large STOP notice before you posted this new issue, support requests aren't Major.
The answer to your question is no, but if you can find a module that generates a random global token, you can use it as a default to a hidden component.
Comment #2
smurfxx CreditAttribution: smurfxx commentedI'm sorry for the priority that I assigned!
I used the module "custom token" and created a system token that it's seen from any content of my drupal site except as default value of ANY component of Webform.
I can see my token in the /admin/help/token page, its name is [custom:randomticket] but I can't use that!
Comment #3
DanChadwick CreditAttribution: DanChadwick commentedI believe this is the same issue as #2339473: webform token removal interferes with other module markup. Webform substittues the tokens that it knows about and removes any others so the use won't see [your-broken-token] in the output.
This is probably a problem because custom token hasn't done its substitutions yet.
See comment #13 in the related issue. Try changing 'clear' => TRUE to 'clear' => FALSE to see if that resolves your issue. Please post the results in the related issue, regardless of the outcome.
Comment #4
DanChadwick CreditAttribution: DanChadwick commentedI actually just tried this with the token_custom module and it seemed to work fine. Please re-open with step-by-step reproduction instructions. What is in '[custom:randomticket]' and how is it defined?
Comment #5
smurfxx CreditAttribution: smurfxx commentedYou're right! I was confused with an another site that use drupal, in the site where I want to use the token that was installed te 3.x version, I uninstalled that and installed the latest stable release, now everything is working, thank you very much and sorry!!!
Comment #6
DanChadwick CreditAttribution: DanChadwick commented