I have no confirmation message (Thank you, your submission has been received) when I submit a form and I'm not logged.

Comments

quicksketch’s picture

You may not see this message if you have the page cache enabled (admin/settings/performance). I believe this has been fixed in 3.x because we actually allow anonymous users to edit their own submissions, meaning that Webform may disable the page cache temporarily and make these messages visible. I'd suggest entering a confirmation message for the Webform so that Webform will display the confirmation message on a separate page (node/x/done usually).

phdenis63’s picture

Thanks for your help. You're right. Confirmation message on a separate page has no problem for anonymous users.

quicksketch’s picture

Title: no confirmation message for anonymous sender » No confirmation message for anonymous sender

I've confirmed this problem does still exist in the 3.x version unfortunately.

- Turn on page caching at admin/settings/performance.
- Create a new Webform, add a component.
- Under "Form settings", add both a confirmation message and a redirect URL.
- Submit the form as a registered user, you are redirected and shown a message.
- Submit the form as an anonymous user, you a redirect but the message is not shown.

Now that Webform tacks on a ?sid=x identifier on all redirects, we could simply check if $_GET['sid'] is set and disable the page cache if that occurs.

quicksketch’s picture

Category: bug » support

I just spent a good long time trying to figure out the cause of this bug, as it turns out, I had a bad problem with my sandbox where UID 0 had been deleted from the "users" database table. This had the effect of making ALL anonymous messages not work. After re-inserting the UID 0 row into the users table, I couldn't reproduce this problem any more, in either 2.x or 3.x. A clean install of Drupal reveals this problem does not exist in either version of Webform. My guess is you might have a similar problem, or another module is somehow clearing the messages.

Anonymous’s picture

In my case this problem occurs on one site but not in one other ! Same configuration Drupal 6.16 and Webform 3.2.
This is weird. Furthermore warning messages for empty fields are correctly displayed in the same time...

I had no UID 0 : seems it was changed to another number... I set it back to 0 and message confirmation works ! Thanks to you quicksketch !

Well, I've done some investigations. I am currently working on a draft site which is in fact a perfect clone of the production one. The clone is a brand new one, no more than a few days old and there are not a lot of changes from the production to it.

Maybe the problem arrived during the database cloning...
On cloned database it seems UID 0 has been changed to UID 9 : the greater UID of the table.

quicksketch’s picture

Title: No confirmation message for anonymous sender » No confirmation message for anonymous sender (UID 0 missing from database)
Status: Active » Fixed

Yeah I think there's some module out there that's likely calling the user_delete() function with a NULL value. It's supposed to take a UID, so you usually see things like user_delete(NULL, $account->uid). However, I found that passing NULL as the UID will delete UID 0! That's pretty dangerous since 1) There's no indication that user ID 0 would be deleted and 2) It causes all kinds of very obscure problems (like this one). It also has some bad effects on Views when dealing with anonymous content.

However I checked Drupal 7 and tried to do the same thing there, fortunately it throws a PDO exception and UID 0 is kept in-tact. I'm not sure this will get fixed in Drupal 6 though, since it's only apparent if some other module is mistakenly passing in a NULL uid. However I have no idea which module did this to me, it could have been any number of modules that delete users, or even core itself.

Ah well. As far as Webform is concerned, this problem is fixed. I'll keep an eye out for modules that might be causing this behavior, but in the mean time there's no module to point at.

phdenis63’s picture

Sql command to recreate missing anonymous user:

INSERT INTO users SET uid = 0, name = 'anonymous'; INSERT INTO users_roles VALUES(0,1); DELETE FROM cache;
(Information from http://agaric.com/note/drupal-deleting-user-uid-0)

Do not forget to add the table prefix if needed

Status: Fixed » Closed (fixed)

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

oxford-dev’s picture

I'm having the same problem but I DO have user 0 in the database.

It could possibly be due to my site using Boost module, I will try and dig deeper and report back.

oxford-dev’s picture

I can now confirm this erroneous behaviour is due the Boost module being enabled.

sinini’s picture

Version: 6.x-2.9 » 7.x-3.15

i don't have the boost module installed, but neither with a logged in user nore with an anonymious user, i get a confirmation message. The user with UID 0 was missing, but after creating him, it still doesn't work...

Redirecting to a confirmation page works, but is not, what i want wo display...