Notes on Webform 6.x-3.2

Recently I have been trying to figure out how to put a nodereference field or a views reference field on a webform so that the user can select from a dynamic list of nodes when filling out the form.

There is a module that accomplishes that function, Webform View Reference Component but it only works with the new webform 6.x-3.2. Now I'm all for upgrading but I run a multisite Drupal install with 60+ websites, about 10 of those sites use the webform module to do some slick stuff with forms. I use that fancy %get[key] to add default variables to my webform, then email the results of the webform.

I have several websites that do apartment listings. On the main listing page as well as the detail pages, I have created buttons that link to a URL crafted to look like this; http://example-apartment-search.com/apartments/check-availability?listin.... check-availability is the URL of a webform that has a hidden field on it. The value of this hidden field is %get[listing], which is the name of the apartment listing that the viewer is interested in. So basically, everything after the '?listing=' in the URL becomes the default value of my webform. That allows me to know which apartment listing was clicked on, and therefor which apartment the visitor is interested in.

For whatever reason, the latest version of webform 6.x-3.2 will not by default send the value of a hidden field in the email that is generated. So first off you have to patch the hidden.inc file with the patch found here. So I've done that and now the value of the hidden field is property emailed to the administrator.

Normally this technique works great. For this most recent project the client is specifying that the user be able to see a select list and change the apartment to another selection.

Webform Views Reference Component seems to do a good job. It displays a select list for the user to choose from, only thing is that I haven't figured out how to set the default value to a value from the URL. By the way, the patch from this post does exactly the same thing as the Webform Views Reference Component as far as I can tell.

I'll attach the patched webform module just for future reference. Only thing that has changed is the hidden.inc file.

Contact Me

Feel free to contact me.

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.