Due to the fact that the delta field in the block table is only a 32 varchar field, when I create a widget name over 30 characters I get this error when I try to visit admin/structure/block

PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'delta' at row 1: INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => widgets [:db_insert_placeholder_1] => s_socialmedia_profile-footer_buttons [:db_insert_placeholder_2] => racingtheme [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => -1 [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => -1 ) in drupal_write_record() (line 7106 of /Users/Gideon/Sites/d7/httpdocs/includes/common.inc).

This happened when creating a new http://drupal.org/project/socialmedia block.

This small patch seems to fix it.

Comments

yanniboi’s picture

Issue summary: View changes
Status: Active » Reviewed & tested by the community

This is a great patch and fixes the issue. Please commit :)

hart0554’s picture

StatusFileSize
new1.42 KB

I tweaked this patch slightly to be able to apply it from the module directory rather than from the drupal root.