0

I am converting a Drupal 7 webform that uses two tokens in a text field's default data field to display data passed in via the URL e.g.

/myform?civicaseID=12345&sessionID=6789&cid1=9876&cid2=8765&cid3=7654

The tokens in the text fields default value are:

[current-page:query:civicaseID] [current-page:query:sessionID]

The link, created from a Drupal View, supplies all the data. Some links include ...&sessionID={{ xyz }} and some do not depending on the context. The same form is reused for all instances, it is just that for some, we do not need to display this additional session ID data.

For all cases it displays the CiviCRM case ID as it is always present, the second token would not print if there was no data in the URL, now, it just prints the token itself if there is no data e.g. for this URL:

/myform?civicaseID=12345&cid1=9876&cid2=8765&cid3=7654

It populates that text field with:

12345 [current-page:query:sessionID]

Is there a setting/technique to hide this behaviour somewhere, or is it a bug?

1 Answer 1

1

OK - I found the answer with a bit of a hack - you need to include the parameter in the URL whether you are going to use it or not.

So in my View I used to create and display links to this form with parameters depending on the context. Now, I just include &sessionID= and it works fine e.g. even though I know a particular link does not need this parameter, I just supply it anyway:

/myform?civicaseID=12345&cid1=9876&cid2=8765&cid3=7654&sessionID=

This seems to work fine and I've not seen any side effects for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.