No checking/catching for unique database columns

cyrific - October 8, 2005 - 22:23
Project:Drupal
Version:4.6.4
Component:block.module
Category:bug report
Priority:critical
Assigned:cyrific
Status:won't fix
Description

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

#1

cyrific - October 8, 2005 - 22:27
Component:book.module» block.module

#2

Malthus - October 9, 2005 - 13:36
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

#3

wulff - October 9, 2005 - 15:45

AFAICT This has been fixed in HEAD.

#4

greggles - January 10, 2006 - 21:50

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.

#5

greggles - January 10, 2006 - 23:01

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

#6

Netlynx - January 19, 2006 - 13:15
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.

#7

greggles - January 19, 2006 - 14:20
Status:active» won't fix

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

 
 

Drupal is a registered trademark of Dries Buytaert.