There should be a validation when giving titles to the Regions or alternatively a way to assign the panels custom machine names.
I created a custom layout and named a region in it Product Demo - Apple App Store Style. The respective machine name created by the code was product_demo___apple_app_store_style.
This value is too long for the panels column and I received an error:
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'panel' at row 1: INSERT INTO {panels_pane}...
saving the panels after assigning content.
Changing the title of the region apparently doesn't change the machine name, so the only workaround is to delete the region and create it again with a shorter name.
Comment | File | Size | Author |
---|---|---|---|
#18 | panels-data_too_long_for-1042368-18.patch | 1.44 KB | thePanz |
Comments
Comment #1
OnkelTem CreditAttribution: OnkelTem commentedSame happens with layout column and with layout name. I wonder why these columns are limited to such an inadequate length - varchar(32). Why this weird economy?
I'd prefer to use long descriptive names, which of course doesn't eliminate the necessity to check value length before sending to the database.
Comment #2
OnkelTem CreditAttribution: OnkelTem commentedHow have you 'created custom layout'? I can't reproduce what you describing.
Comment #3
OnkelTem CreditAttribution: OnkelTem commentedsimple patch for ctools. (Should go into CTools issues queue actually)
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedWe should go ahead and lengthen that field, 32 characters is needlessly short, I agree. 128 or 255 would be just fine.
Comment #5
FreeFox CreditAttribution: FreeFox commentedSetting field 'panel' to 255 in table 'panels_pane' works for me.
Comment #6
steenbob CreditAttribution: steenbob commentedsubscribe
Comment #7
obrienmd CreditAttribution: obrienmd commented#5, works for me too, does this patch fix the problem 'correctly'?
Comment #8
merlinofchaos CreditAttribution: merlinofchaos commentedNot sure why you moved this to CTools, the panels_pane table is definitely in Panels.
That said I committed a patch recently that fixes this already.
Comment #9
obrienmd CreditAttribution: obrienmd commentedMy mistake. Moved back (because I'm OCD), closed, etc...
Comment #10
Tino CreditAttribution: Tino commented#5 works perfect, thanks!
Changed the field length op field 'panel' in table 'panels_pane' from 32 to 255 with phpmyadmin.
Or:
ALTER TABLE `panels_pane` CHANGE `panel` `panel` VARCHAR( 255 );
Comment #11
yurtboy CreditAttribution: yurtboy commentedThanks for the fix on this. I was running 7.x-3.0-alpha3 and had this issue. I also ran
ALTER TABLE `panels_display` CHANGE `layout` `layout` VARCHAR(255) NULL DEFAULT '';
But then realized I was not using that latest version of Panels which had this patch.
Comment #12
skribbz14 CreditAttribution: skribbz14 commentedThanks, helped a lot!
Comment #13
Yura Filimonov CreditAttribution: Yura Filimonov commentedI am getting the same error in the latest build of the 7.x version of the Panels.
What do I do now?
Thanks.
Comment #14
zil.arman CreditAttribution: zil.arman commentedi've faced the same issue. patch does not help.
Comment #15
zil.arman CreditAttribution: zil.arman commented#5 helps.
thank you @FreeFox !
Comment #16
zuernBernhard CreditAttribution: zuernBernhard at UEBERBIT GmbH commentedComment #17
thePanz CreditAttribution: thePanz at Liip for FREITAG lab. AG commentedThe attached patch fixes this issue,updated the column definition to use 255 as length.
Apply the same edit to "subtye" and "type" columns.
Comment #18
thePanz CreditAttribution: thePanz at Liip for FREITAG lab. AG commentedRerolled patch
Comment #19
thePanz CreditAttribution: thePanz at Liip for FREITAG lab. AG commentedComment #21
japerrytested the update, looks good to me. Fixed.