When copying/modifying webform-confirmation.tpl.php into a custom theme, the template file is not respected unless the field "Confirmation message or redirect URL" has ANY value in entered in the webform node. Without a value in that field, the default template is used.

Note, I am also providing a nid in the filename, as per the comment at the top of the default file. Thus, the name of the template is:
webform-confirmation-50.tpl.php

Comments

quicksketch’s picture

Category: bug » support
Status: Active » Fixed

Without a value in that field, the default template is used.

I think it's not that a "default" template is used, it's that a template isn't used at all. If there is no confirmation message at all, then Webform redirects and shows a message instead of showing as a page.

I don't think this will be changed in the 2.x branch, though we're changing the functionality of the redirect url and confirmation message entirely in #520524: Redirect URL and confirmation message should be two different fields, which would correct this problem. I'm just marking this fixed as a support request, since I don't intend to correct this in 2.x.

mdeltito’s picture

yes, having separate fields definitely mitigates this entirely, thanks for checking it out

Anonymous’s picture

Status: Fixed » Active

I ran into this problem also and kept banging my head against the wall trying to figure out why my webform-confirmation.tpl.php wasn't being used at all.

To prevent other people from also getting bloodied foreheads could you add something to the documentation or THEMING.txt file that explicitly warns people that the file will only be used if a message is entered in 'Confirmation message or redirect URL:' field?

I'll add a comment to http://drupal.org/handbook/modules/webform/faq about this. I would have liked to add edit the page and add an FAQ entry but editing is restricted on that particular page

Anonymous’s picture

Added this node to the documentation. I hope it is accurate!

http://drupal.org/node/716996

quicksketch’s picture

Status: Active » Fixed

Thanks totsubo, though the 2.x version is quickly reaching end-of-life. I expect we'll end support for it entirely within the next 2 months. This issue does not affect 3.x.

Anonymous’s picture

Hopefully it won't reach end of life until 3.x is available :)

I'm dying to try it but since I have a production site I'm a bit wary ...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.