When creating a custom block, the user is prompted for a "block description." The field is not marked as required. Since the description is likely to be redundant to the title, many admins may simply leave the description blank.

In the database "boxes" table, the description is recorded in "info," which is defined as

`info` varchar(128) NOT NULL default '',

In addition, the column is indexed and marked UNIQUE. (Why??)

As a result, omitting the description for more than one block causes an error like so:
user error: Duplicate entry '' for key 3
query: INSERT INTO boxes (title, body, info, format) VALUES ('Test block', 'This is an empty block.
', '', 1) in /(path)/includes/database.mysql.inc on line 66.

CommentFileSizeAuthor
#1 block_description.patch1.39 KBtostinni
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tostinni’s picture

Version: 4.6.0 » x.y.z
Status: Active » Reviewed & tested by the community
FileSize
1.39 KB

I think the unicity is to help admin find their blocks, but the bug is still there.
In the CVS version, there's 2 little bugs corrected by this patch :
- description field isn't marked as requiered
- when the field isn't unique, an error is displayed, but the wrong text field is set as erronous.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD.

Anonymous’s picture

Uwe Hermann’s picture

Version: x.y.z » 4.6.0
Status: Fixed » Closed (fixed)