When adding a block it displays an error message. Was able to create 1 block and block only. Never worked after the first time.

This is the Error Message:

"user error: Duplicate entry '' for key 3
query: INSERT INTO boxes (title, body, info, format) VALUES ('Test', 'Test', '', 1) in /home/cyrific/public_html/ost/includes/database.mysql.inc on line 66.
warning: Cannot modify header information - headers already sent by (output started at /home/cyrific/public_html/ost/includes/common.inc:384) in /home/cyrific/public_html/ost/includes/common.inc on line 192."

Thank You

Comments

cyrific’s picture

Component: book.module » block.module
Malthus’s picture

Title: Won't Create New Blocks » No checking/catching for unique database columns

cyrific: you need to provide a unique description for each block that you add in block "Block description:"

Drupal devs possible actions:

  1. make the form item 'required'
  2. validate the block add form
  3. catch errors and notify the user that the unique entry already exists
wulff’s picture

AFAICT This has been fixed in HEAD.

greggles’s picture

Indeed - it has been fixed in head: http://drupal.org/node/11724 but not in 4.6.x

Seems that the solution is simple according to: http://drupal.org/node/14158#comment-22490

Note, I haven't tested what drumm suggests.

greggles’s picture

I just marked http://drupal.org/node/44013 as a duplicate of this item.

netlynx’s picture

Version: 4.6.3 » 4.6.4

So, just be clear, from following various threads on this issue I believe the current status is that:

1. To fix it on 4.6.x you need to remove the unique constraint (title on 'boxes' table) in the database (I have tried this and it seems to work, but not extensively tested)
2. It won't be fixed in 4.6.x due to the requirement for a DB change.
3. It is fixed in HEAD, which refers to the coming 4.7 release.

greggles’s picture

Status: Active » Closed (won't fix)

According to Netlynx description, this is "won't fix" for 4.6.x