Active
Project:
SugarCRM Webform Integration
Version:
5.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Oct 2008 at 02:02 UTC
Updated:
2 Mar 2009 at 22:36 UTC
The redirect field url was always defaulting to the node done page when I entered anything into the confirmation/redirect text box after updating to the latest webform-5.x-2.1.3 in drupal 5.7. I think some of the webform node info changed so I modified the sugarwebform.module a bit to make it work for me. Here is the original block:
if (valid_url(trim($node->confirmation), true)) {
$redirect = trim($node->confirmation);
}
elseif (preg_match('/^internal:/', $node->confirmation)) {
$path = preg_replace('/^internal:/', $base_url .'/', $node->confirmation);
$redirect = trim($path);
}
else {
// create an absolute URL for the SugarCRM lead capture page to send the user back to
$redirect = url('node/'. $node->nid .'/done', NULL, NULL, TRUE);
}
and I changed it to:
$confirmation = $node->webform["confirmation"];
if (valid_url(trim($confirmation), true)) {
$redirect = trim($confirmation);
}
elseif (preg_match('/^internal:/', $confirmation)) {
$path = preg_replace('/^internal:/', $base_url .'/', $confirmation);
$redirect = trim($path);
}
else {
// create an absolute URL for the SugarCRM lead capture page to send the user back to
$redirect = url('node/'. $node->nid .'/done', NULL, NULL, TRUE);
}
Working ok for me. Will do some more testing though.
Comments
Comment #1
UnicornSong commentedThank you Vector, that worked for me too :)