I have my drupal site set up so that anonymous users are allowed to create content. I've been testing it out, and when I submit a page or story as an anonymous user, I get a page with nothing but the error below. The content is still submitted, but I'm sure any user encountering this error would assume it hasn't been and try to submit it over and over again.

I have searched drupal.org and found nothing that worked. Please help, as I'm hoping to have my site go live in the next week or so. If you need to look at the actual site, it's at http://www.megancrewe.com/exchange

The error:

user error: Duplicate entry '' for key 2
query: INSERT INTO users (created, changed, uid) VALUES ('1124278665', '1124278665', '7') in /home/mlcrewe/public_html/exchange/includes/database.mysql.inc on line 66.

warning: Invalid argument supplied for foreach() in /home/mlcrewe/public_html/exchange/modules/user.module on line 174.

warning: Cannot modify header information - headers already sent by (output started at /home/mlcrewe/public_html/exchange/includes/common.inc:384) in /home/mlcrewe/public_html/exchange/includes/common.inc on line 192.

Comments

tostinni’s picture

The thing I don't understand is why do you have the creation of a new user that happens when you submit a node as anonymous ?
Can you give us the list of modules you use ?

I try to reproduce this using a flexinode with taxonomy and subscription modules, and I couldn't be able to reproduce your error...

melusine’s picture

The modules I'm using (beyond the base ones): bookmarks, emailpage, helpedit, indexpage, invite, quote, subscriptions, taxonomy_browser, troll, and userpoints.

Possibly I should mention that if you try create content as an anonymous user, you won't be able to see that it was created, as it'll have gone into the moderation queue. And I am not getting this error posting as a registered user (admin or authenticated).

tostinni’s picture

I'm unable to reproduce your bug and I still don't understand why does an insert appears in submitting a node.

So I suspect on of your modules to try to register a user invoking user_save function or it can be something like module_invoke('user','save').
Can you try to disable one by one your contributed modules and see if the problem is still there ?

In fact, have a look at your users table, you should see a new user without name and mail being created...

Also I see that you miss a patch I made for disabling susbcription to anonymous users.

Zen’s picture

Status: Active » Closed (fixed)

This doesn't appear to have anything to do with the Drupal base system. Please isolate which module is causing this issue, and resubmit the bug report to the right area.

Changing status to closed.
-K