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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

OnkelTem’s picture

Priority: Minor » Normal

Same 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.

OnkelTem’s picture

How have you 'created custom layout'? I can't reproduce what you describing.

OnkelTem’s picture

simple patch for ctools. (Should go into CTools issues queue actually)

merlinofchaos’s picture

We should go ahead and lengthen that field, 32 characters is needlessly short, I agree. 128 or 255 would be just fine.

FreeFox’s picture

Setting field 'panel' to 255 in table 'panels_pane' works for me.

steenbob’s picture

subscribe

obrienmd’s picture

Project: Panels » Chaos Tool Suite (ctools)
Version: 7.x-3.0-alpha2 » 7.x-1.x-dev
Status: Active » Needs review

#5, works for me too, does this patch fix the problem 'correctly'?

merlinofchaos’s picture

Status: Needs review » Closed (duplicate)

Not 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.

obrienmd’s picture

Project: Chaos Tool Suite (ctools) » Panels
Version: 7.x-1.x-dev » 7.x-3.x-dev

My mistake. Moved back (because I'm OCD), closed, etc...

Tino’s picture

#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 );

yurtboy’s picture

Thanks 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.

skribbz14’s picture

Thanks, helped a lot!

Yura Filimonov’s picture

Version: 7.x-3.x-dev » 7.x-3.5
Issue summary: View changes
Status: Closed (duplicate) » Active

I am getting the same error in the latest build of the 7.x version of the Panels.

What do I do now?

Thanks.

zil.arman’s picture

i've faced the same issue. patch does not help.

zil.arman’s picture

#5 helps.
thank you @FreeFox !

zuernBernhard’s picture

function MYMODULE_update_7000(&$sandbox) {
  // Increase length for type column in panels_pane
  $new_type_spec = array(
    'type' => 'varchar',
    'length' => '255',
    'default' => '',
  );
  db_change_field('panels_pane', 'type', 'type', $new_type_spec);

  // Increase length for pane column in panels_pane
  $new_panel_spec = array(
    'type' => 'varchar',
    'length' => '255',
    'default' => '',
  );
  db_change_field('panels_pane', 'panel', 'panel', $new_panel_spec);
}
thePanz’s picture

Status: Active » Needs review
FileSize
1.44 KB

The attached patch fixes this issue,updated the column definition to use 255 as length.
Apply the same edit to "subtye" and "type" columns.

thePanz’s picture

FileSize
1.44 KB

Rerolled patch

thePanz’s picture

Version: 7.x-3.5 » 7.x-3.x-dev
Status: Needs review » Reviewed & tested by the community

  • japerry committed dcd6a5b on 7.x-3.x authored by thePanz
    Issue #1042368 by thePanz, OnkelTem: Data too long for column 'panel'
    
japerry’s picture

Status: Reviewed & tested by the community » Fixed

tested the update, looks good to me. Fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.