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 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.
Comment | File | Size | Author |
---|---|---|---|
#1 | webform_module_redirect.patch | 2.42 KB | jnt |
Comments
Comment #1
jnt CreditAttribution: jnt commentedHere 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:
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.
Comment #2
ullgren CreditAttribution: ullgren commentedAdded patch to CVS
Comment #3
jnt CreditAttribution: jnt commentedComment #4
ullgren CreditAttribution: ullgren commentedNow closed since no error are reported.