squeeze.module on line 61
if ($user->uid > 0) {
$sid = db_result(db_query("SELECT sid FROM {webform_submission} WHERE nid = %d AND uid = %", $squeeze_page_nid, $user->uid));
}
else {
$sid = $_SESSION['webform_submissions'][$squeeze_page_nid];
}
uid = % argument is missing modifier (uid = % should be uid = %d)
{webform_submission} should be {webform_submissions}
once I fixed the above problems it works for anonymous users and for logged in user once the form has already been submitted (revisit). but it does not work for logged in users with no previous form submission.
$sid needs to be set for 3 conditions
1. condition: user = 0, $sid = $_SESSION['webform_submissions'][$squeeze_page_nid];
2. condition: user > 0 & db_results = false, $sid = $_SESSION['webform_submissions'][$squeeze_page_nid];
3. condition: user > 0 & db_results = true, $sid = db_results
Form the above code it looks like $sid is only set for 2 conditions as condition 3 results in an empty query.
1. condition: user = 0, $sid = $_SESSION['webform_submissions'][$squeeze_page_nid];
2. condition: user > 0, $sid = db_results
Comments
Comment #1
pavel.karoukin commentedWow. Not sure how this sneaked there. Looks like I did not tested it with authenticated users enough.
Thank you for bugreport. I will fix it soon!
Comment #2
ndwilliams3 commentedI did not notice it either as I tested anonymous. I tried adding another if statement for option 3 but could not get it to work. It always redirects to the form confirmation page on submit instead of the file. Thanks for the quick response
Comment #3
pavel.karoukin commentedJust commited fix (should be available today in the dev .tar.gz release). Here is diff - http://drupalcode.org/viewvc/drupal/contributions/modules/squeeze/squeez...
Let me know if it works for you and thank you again for spotting this!
Comment #4
ndwilliams3 commentedstill not working for authenticated users. Still getting the webform confirmation page.
Comment #5
ndwilliams3 commentedI am thinking that function squeeze_webform_save_sid_on_submit on line 124 might be the culprit. looks like the redirect is only set for anonymous users. Not familiar with webform or $_SESSION, so I am not sure.
Comment #6
ndwilliams3 commentedThink I have a fix
line 60
change to
line 124
change to
Working for me for both authenticated user and anonymous user.
Comment #7
pavel.karoukin commentedSorry for slow response and thank you for submitting code changes!
I am not sure we need first part of code change, but second one is definitely bug fix. I've committed it in to CVS. Please let me know if it work for you or no (it works for me). Updated -dev package should be available soon. Here is diff of change - http://drupalcode.org/viewvc/drupal/contributions/modules/squeeze/squeez...
Comment #8
pavel.karoukin commentedI assume bug is fixed finally so I am closing this issue. Feel free to reopen it if you will find problem with it! And thank you very much for helping with it!