In Date Tools creating new content type:
Your content type ActivityDate has been created.
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, title) 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] => views [:db_insert_placeholder_1] => calendar_activitydate-calendar_block_1 [:db_insert_placeholder_2] => bartik [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => -1 [:db_insert_placeholder_5] => sidebar_first [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => ) in drupal_write_record() (line 6846 of /srv/www/htdocs/DEVTEST/includes/common.inc).
Delta field in Table BLOCK is defined:
`delta` varchar(32) NOT NULL DEFAULT '0' COMMENT 'Unique ID for block within a module.',
This is not the first time I encounter this kind of problem.
May be Drupal CORE should make this field 64 because of the long standard naming system?
Comment | File | Size | Author |
---|---|---|---|
#4 | Screen-shot-2011-07-07-at-7.56.jpg | 199.65 KB | chiappa |
Comments
Comment #1
bkmarsh CreditAttribution: bkmarsh commentedsubscribe
Comment #2
KarenS CreditAttribution: KarenS commentedI made a few changes to make a slightly longer content type name work and added some validation to the Date Tool to prevent you from trying to create a block that will be too long for that field.
Comment #4
chiappa CreditAttribution: chiappa commentedThank you! I am a total n00b yet I managed to solve it & my headache is gone.. This happened to me a couple of times as well, on the weirdest occasions.
For the next victim, I have attached a screenshot of phpmyadmin, where you need to go and change the 32 to a 64. In the screenshot it says varchar(64) but obviously it's going to show varchar(32) which you need to change.
Comment #5
BeaPower CreditAttribution: BeaPower commenteddo you change all 3 to 32? Because in drupal 7 - delta is already 32
Comment #6
choosedrupal CreditAttribution: choosedrupal commentedGreat, it worked for me. Thanks for the post.
Turned out to be caused by cloning a mini panel. It added "clone_" to a machine name which caused this error.
Comment #7
bernard63 CreditAttribution: bernard63 commentedI changed the value of VARCHAR to 64 then 255 and still have the same problem:
I don't know how to solve this problem.
Comment #8
se7en76 CreditAttribution: se7en76 commentedI also had the issue just after having duplicated a mini-panel.
Direct database fix worked quietly for me. You're wonderful guys! thks again :)
Comment #9
subhojit777thank you very much :) you saved my life
Comment #10
vacho CreditAttribution: vacho commentedI have solved thanks to your response. Thanks..
Comment #11
jchatard CreditAttribution: jchatard commentedWell just encountered the same behavior, so this cannot be considered fixed as it requires manual database tweaks.
Comment #12
jchatard CreditAttribution: jchatard commentedChanging the status of the issue, as using a different LAMP stack don't let me reproduce the error.
Comment #13
sudhanshushekhar CreditAttribution: sudhanshushekhar commented#4 This is a perfect solution. Thanx a lot.
Comment #14
aaronmeister CreditAttribution: aaronmeister commentedI encountered this same problem when I cloned a mini panel.
I deleted the panel and just created a new mini panel with the necessary particulars. Much more simple than altering the database, which I'm not comfortable with.
Comment #15
jojojibba CreditAttribution: jojojibba commentedYessssss! Good solution. Thanks.
Comment #16
jmbailey CreditAttribution: jmbailey commentedJust wanted to thank post #4. Worked great!
Comment #17
therobyouknow CreditAttribution: therobyouknow commented#4 worked for me too - I did it in the command line:
So thank you, post #4, spot on, right on the money, thank you very much! Anyone who hasn't got this to work please comment here with more detail and we'll see if we can help, I want to be optimistic this would work for you.
(Just a side note/helpful tip: The poster of #4 has drupal as their prefix on table names in their db, which allows them to have the drupal tables in the same database used by other programs as it allows their drupal installation to 'pick out' the correct tables (drupal install provides for prefix to table names). This is a useful approach particularly for shared hosting environments where databases allowed are limited by package chosen. In my case I didn't use such a prefix so all I needed to refer to was the block table without a prefix. Note that I didn't include the other parameters shown in #4 post like UTF stuff as I think these are superfluous in this fix and were perhaps added by phpmyadmin; I just changed what was needed to be changed. By the way I love phpmyadmin but didn't have it set up on my system at the time.)
Comment #18
sunly917 CreditAttribution: sunly917 commentedGreat post.
Comment #19
zuernBernhard CreditAttribution: zuernBernhard at UEBERBIT GmbH commentedComment #20
drusims CreditAttribution: drusims as a volunteer commentedIt is too bad you fixed it this way because it does not let the Migrate module handle long file names (and, for instance, shorten them)
Comment #21
mchar CreditAttribution: mchar commentedComment #4 seems to be the case.
This is what I did:
block
table:mysqldump -uroot -p my_database block > block.sql
drush sql-query "select * from block" > block.txt
so to be able to have a view of the data before and after the change.
drush sql-query "alter table block MODIFY delta VARCHAR(64)"
desc block
atMySQL
and see the actual change on the delta table fromdelta | varchar(32)
todelta | varchar(64)
Comment #22
sunil-kumar CreditAttribution: sunil-kumar commentedVery useful.