user error: Duplicate entry '' for key 3
query: INSERT INTO boxes (title, body, info, format) VALUES  ('test', 'test', '', 1) in /XXXXX/XXXXX/public_html/cms/includes/database.mysql.inc on line 66.

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

hi,

i get this error when i want to add new blocks.

after the install I have been able to add blocks, but now i get this error.

i hope you can help me :)

greetings

ogu

Comments

ogu’s picture

Type php
Date Sunday, April 17, 2005 - 16:58
User XXXXX
Location /XXXXX/cms/?q=admin/block/add
Message Duplicate entry '' for key 3 query: INSERT INTO boxes (title, body, info, format) VALUES ('test', 'test', '', 1) in /home/ogu/public_html/cms/includes/database.mysql.inc on line 66.
Severity error
Hostname XX3.2X.X11.XXX

ogu’s picture

hello,

is there no solution. i cant create blocks :(

i could not find anything to my problem.

greets

-ogu

ianivs’s picture

Looks like 'title' and 'info' are unique indexes for the boxes table so you can only have one block with an empty title.
I'm new to Drupal, so I'm not sure if this is a bug or a feature. Why restrict what the title of the block can be? I actually need to use a few blocks that have no title.
I removed the uniqueness constraint on the title and it didn't seem to break anything.

ogu’s picture

hi,

i get the same error when i want to add blocks without a title.

-ogu

xian’s picture

ITS giving me that error even when i add a title to the block.

user error: Duplicate entry '' for key 3
query: INSERT INTO boxes (title, body, info, format) VALUES  ('Search This Site', 'here goes my content', '', 1) in /home/proto/public_html/x/includes/database.mysql.inc on line 66.</pre><pre>warning: Cannot modify header information - headers already sent by (output started at /home/proto/public_html/x/includes/common.inc:384) in /home/proto/public_html/x/includes/common.inc on line 192.

thats the error i get whenever i try to add a new block. it did not give me this error earlier, it only started yesterday. i'm using drupal 4.6

bassem’s picture

you can avoid such problem by filling out the "title" field and the "description" field at all times,
obviously the "title" and "info"=[description] both form the key of the record in the database, so you can have no more then one block with no title and also no more then one block with no a description.

gumrol’s picture

I just had to post this, even on this old thread. I was looking for a solution to this problem, and this thread came up first in my google search.

I found an article here:
CMSReport.com

It totally saved me. The article mentions why this happens and how to fix it. Its to do with Drupal's mechanism of seeding, or setting the next id for anything from a node, comment, file etc. When it gets out of synch for whatever reason (in my case it was because I'd hacked nodes into the database), the sequence table gets out of synch with the next id to generate and then the primary key insertion fails. Check out the article, well worth it.

[ g ]
Posted by greencarrots