I cannot easily create blocks without a name (displayed): I can only create one such block and if I try to create another one I get the msg that it is a duplicate.

By name I mean the text displayed on the screen, not the internal name, i.e. the title text.

What is needed is a checkbox "Display title?" or the ability to create multiple blocks without titles.

CommentFileSizeAuthor
#7 block.module_4.patch436 bytesñull
#6 block.module_3.patch436 bytesñull

Comments

andremolnar’s picture

Title: Blocks without a name » Adding two custom blocks with the same name produces a sql warning

confirmed - block module does not validate 'title' field in the custom block form

'title' should be a required field - and/or validation function needs to be added to check that 'title' is unique as {boxes} table is set up with a title field as a unique key - or title field data type should be changed in {boxes} table

See lines 322 to 347 in block.module

andre (just trying to better flag bug reports)

Chris Johnson’s picture

I propose that we remove the unique key from the title column of the boxes tables, so that block boxes could have duplicate titles.

I also propose we modify the calls to form_textfield() in block_box_form() to make the desciption ('info') field be required, and the database will retain its constraint of forcing it to be unique. We should leave the title field as optional, and thus it could be blank, as is now, and because of the removal of the unnecessary unique constraint above, one could actually have multiple, untitled block boxes.

The case of duplicate description ('info') fields should be coded for in the block_box_save() routine to catch the SQL error of duplicate keys.

moshe weitzman’s picture

Priority: Critical » Normal
ñull’s picture

Version: » 4.6.2

In 4.6 this is still an issue. Could something be done about it? Although this is not critical nor urgent, it IS irritating that not more then one untitled blocks are allowed, restricting user freedom.

ñull’s picture

In 4.5.1 I could still use a HTML comment in the title, to make it invisible and unique. This was removed this in 4.6.x. May be it would be the simplest to allow HTML in the title again, which gives the user flexibility to use graphical title headers. In fact one of my clients is using this and it would break once I upgrade to 4.6.x.

ñull’s picture

StatusFileSize
new436 bytes

In 4.5.1 I could still use a HTML comment in the title, to make it invisible and unique. This was removed this in 4.6.x. May be it would be the simplest to allow HTML in the title again, which gives the user flexibility to use graphical title headers. In fact one of my clients is using this and it would break once I upgrade to 4.6.x.

Apparently the following patch is doing what I want.

ñull’s picture

StatusFileSize
new436 bytes

In 4.5.1 I could still use a HTML comment in the title, to make it invisible and unique. This was removed this in 4.6.x. May be it would be the simplest to allow HTML in the title again, which gives the user flexibility to use graphical title headers. In fact one of my clients is using this and it would break once I upgrade to 4.6.x.

Apparently the following patch for 4.6.2 is doing what I want.

tostinni’s picture

This bug has been corrected in CVS version, you're encouraged to roll to the new drupal release when it will be out.

killes@www.drop.org’s picture

Status: Active » Fixed

fixed in cvs.

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)