[drupal-devel] [bug] Empty 'info' in custom block leads to errors

tostinni drupal-devel at drupal.org
Mon Aug 1 18:08:02 UTC 2005


Issue status update for 
http://drupal.org/node/27713
Post a follow up: 
http://drupal.org/project/comments/add/27713

 Project:      Drupal
-Version:      4.6.0
+Version:      cvs
 Component:    block.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  yelvington
 Updated by:   tostinni
-Status:       active
+Status:       patch (ready to be committed)
 Attachment:   http://drupal.org/files/issues/block_description.patch (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.




tostinni



Previous comments:
------------------------------------------------------------------------

Thu, 28 Jul 2005 19:29:58 +0000 : yelvington

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.







More information about the drupal-devel mailing list