If you export a template, rename it, then try to import it, it throws database errors. Here is a copy/paste:

PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'obj' at row 1: INSERT INTO {ctools_object_cache} (sid, obj, name, data, updated) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => 6QlhPX6YCv8EPMh-hFYomqshwCn2IHgWHr7CMKELF2w [:db_insert_placeholder_1] => ctui_heartbeat_templates.export_ui [:db_insert_placeholder_2] => ::import [:db_insert_placeholder_3] => O:24:"HeartbeatMessageTemplate":22:{s:3:"hid";i:0;s:10:"message_id";s:17:"heartbeat_friends";s:5:"perms";i:4;s:11:"description";s:50:"When a user becomes friends with another user (UR)";s:7:"message";s:37:"!username is now friends with !user2.";s:14:"message_concat";s:38:"!username is now friends with %user2%.";s:10:"group_type";s:7:"summary";s:11:"concat_args";a:6:{s:8:"group_by";s:9:"user-user";s:12:"group_target";s:5:"user2";s:15:"group_by_target";s:8:"username";s:13:"group_num_max";s:1:"4";s:15:"merge_separator";s:2:", ";s:19:"merge_end_separator";s:5:" and ";}s:9:"variables";a:2:{s:9:"!username";s:0:"";s:6:"!user2";s:0:"";}s:11:"attachments";a:2:{s:16:"activitycomments";a:2:{s:7:"enabled";i:1;s:21:"activitycomments_node";i:0;}s:14:"flagattachment";a:2:{s:5:"flags";a:1:{s:4:"like";s:4:"like";}s:18:"flag_count_enabled";a:1:{s:5:"flags";i:1;}}}s:5:"roles";a:0:{}s:8:"new_type";N;s:4:"base";N;s:11:"api_version";i:1;s:8:"disabled";b:0;s:13:"export_module";s:0:"";s:11:"export_type";N;s:12:"in_code_only";b:0;s:5:"table";s:18:"heartbeat_messages";s:4:"type";s:5:"Local";s:25:"export_ui_allow_overwrite";i:0;s:14:"export_ui_code";s:1290:"$heartbeatmessagetemplate = new HeartbeatMessageTemplate; $heartbeatmessagetemplate->disabled = FALSE; /* Edit this to true to make a default heartbeatmessagetemplate disabled initially */ $heartbeatmessagetemplate->api_version = 1; $heartbeatmessagetemplate->message_id = 'heartbeat_friends'; $heartbeatmessagetemplate->description = 'When a user becomes friends with another user (UR)'; $heartbeatmessagetemplate->message = '!username is now friends with !user2.'; $heartbeatmessagetemplate->message_concat = '!username is now friends with %user2%.'; $heartbeatmessagetemplate->perms = 4; $heartbeatmessagetemplate->group_type = 'summary'; $heartbeatmessagetemplate->concat_args = array( 'group_by' => 'user-user', 'group_target' => 'user2', 'group_by_target' => 'username', 'group_num_max' => '4', 'merge_separator' => ', ', 'merge_end_separator' => ' and ', ); $heartbeatmessagetemplate->variables = array( '!username' => '', '!user2' => '', ); $heartbeatmessagetemplate->attachments = array( 'activitycomments' => array( 'enabled' => 1, 'activitycomments_node' => 0, ), 'flagattachment' => array( 'flags' => array( 'like' => 'like', ), 'flag_count_enabled' => array( 'flags' => 1, ), ), ); ";} [:db_insert_placeholder_4] => 1327981787 ) in ctools_object_cache_set() (line 75 of \modules\ctools\includes\object-cache.inc).

Comments

fraweg’s picture

Hi,

I have the same issue. Did you solve the problem? Is there a special way to import a template?
Thanks,
Frank

KorbenDallas’s picture

Status: Active » Fixed

Yes, I solved the problem. You must use the development version of ctools. So this means you have to completely uninstall ctools, delete it's module folder, and load the new dev version. If you are using the latest dev version, then your ctools install corrupt; apparently they aren't making use of update.php as they should.

It was quicker for me to install a new instance of Drupal and reinstall everything. It took me a few hours, so hopefully it wouldn't take you as long.

Status: Fixed » Closed (fixed)

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

fraweg’s picture

Hello KorbenDallas,

for me it work to change this value "ctools_object_cache" in the database and make this value bigger.

Thanks for your answer,
Frank