I would like to have ha success-page instead of just a success-textarea (which is a nice default) but it would be nice if to have the option to choose another page to redirect the user. Looks like a simple patch, will try it out and probably be back with a patch later.

CommentFileSizeAuthor
#1 webform_module_redirect.patch2.42 KBjnt
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jnt’s picture

Here is a patch that achieves this. It is very simple, the confirmation field now accepts either a message, as currently, or a relative node address. By doing it this way there is no database changes required.

The code first checks that it is a validly formed relative URL, if it is not it assumes the contained text is a confirmation message and displays it normally.

The patch only verifies the format of relative URLs. To verify the format of absolute URLs as well, it would be only be necessary to call the valid_url function twice as per this fragment:

- if(valid_url(trim($node->confirm))){
+ if(valid_url(trim($node->confirm),false) || valid_url(trim($node->confirm),true)){

I left this out because it may have security implications.

If the relative URL is not found the user gets a standard drupal "Page not Found" error.

ullgren’s picture

Added patch to CVS

jnt’s picture

ullgren’s picture

Now closed since no error are reported.