[drupal-devel] [bug] Blocks with no title kill Drupal

Robin Monks drupal-devel at drupal.org
Sat Apr 9 00:31:32 UTC 2005

Issue status update for http://drupal.org/node/19965

 Project:      Drupal
 Version:      cvs
 Component:    block.module
 Category:     bug reports
 Priority:     normal
-Assigned to:  Anonymous
+Assigned to:  Robin Monks
 Reported by:  budda
 Updated by:   Robin Monks
-Status:       active
+Status:       patch
 Attachment:   http://drupal.org/files/issues/block.module.blank.title.patch (955 bytes)

A small patch that checks to ensure the title does not already exit in
the Blocks list.  Also, if the field was left blank, in adds an HTML
comment with the current date to the second to ensure that a duplicate
title isn't created.
This is my first patch, so I probably did something wrong, but I'm
willing to fix it too.
Robin Monks

Robin Monks

Previous comments:

April 4, 2005 - 17:03 : budda

When setting more than one block's title to '' (blank) Drupal dies, and
doesn't catch the SQL query error nicely. The error is as follows:
user error: Duplicate entry '' for key 2
query: UPDATE boxes SET title = '', body = ' ...<cut>... in
/var/www/html/drupal-cvs/includes/database.mysql.inc on line 66.

Using 4.6 build from 4/4/2005
The page ends with:
warning: Cannot modify header information - headers already sent by
(output started at /var/www/html/drupal-cvs/includes/common.inc:384) in
/var/www/html/drupal-cvs/includes/common.inc on line 192.


April 8, 2005 - 08:08 : robertDouglass

There should be a check before the insert is attempted and if the block
title already exists the user should be notified with form_error().


April 8, 2005 - 09:46 : Poolio

this certainly doesn't solve the problem, but I've worked around this
issue by using html tags in the title field for blocks that I don't
want to show a title.

More information about the drupal-devel mailing list