I created a custom content type (CTools plugin) to use as a pane in Panels. I can add and configure the pane, and update the panel variant without a problem. When I try to save the page however, I get the PDOException below.

Apparently, the 'type' I'm trying to save to the db is 'too long', but I'm not sure where or how to change/set this for my content type. Any idea on how to get around this?

PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'type' at row 1: INSERT INTO {panels_pane} (did, panel, type, subtype, shown, access, configuration, cache, style, css, extras, position) 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, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11); Array ( [:db_insert_placeholder_0] => 3 [:db_insert_placeholder_1] => middle [:db_insert_placeholder_2] => my_custom_node_title_content_type [:db_insert_placeholder_3] => my_custom_node_title_content_type [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => a:0:{} [:db_insert_placeholder_6] => a:4:{s:4:"link";i:1;s:7:"context";s:25:"argument_entity_id:node_1";s:14:"override_title";i:0;s:19:"override_title_text";s:0:"";} [:db_insert_placeholder_7] => a:0:{} [:db_insert_placeholder_8] => a:1:{s:8:"settings";N;} [:db_insert_placeholder_9] => a:0:{} [:db_insert_placeholder_10] => a:0:{} [:db_insert_placeholder_11] => 0 ) in drupal_write_record() (line 6884 of /docroot/www/includes/common.inc).

Comments

merlinofchaos’s picture

I think a recent version of Panels made that field bigger; but that's from the machine name of the custom type. If you make the machine name shorter this will go away, and will serve as a workaround to get you going immediately.

brunodbo’s picture

Status: Active » Fixed

Great, that worked, thanks.

Status: Fixed » Closed (fixed)

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

aaron.r.carlton’s picture

Status: Closed (fixed) » Active

I can confirm that the limit is still at 32 characters. Per IRC, if merlinofchaos suggests at least adding some warning or validation if we don't push through the column change.

GDrupal’s picture

I'm in a project that use ctools content types massively for very specific tasks. I have been dealing with this issue a lot since is difficult to choose a good representative name with a few characters.

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);
}
MustangGB’s picture

Status: Active » Closed (outdated)