Skip to content

Commit 10329d4

Browse files
committed
Merge pull request civicrm#257 from colemanw/CRM-16079
CRM-16079 - OG Sync - trim titles to fit field length constraints
2 parents 4a17848 + d44b9ca commit 10329d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/civicrm_og_sync/civicrm_og_sync.module

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ function _civicrm_og_sync_node_action($node) {
251251
return;
252252
}
253253

254-
$title = trim($node->title);
254+
$title = substr(trim($node->title), 0, 49);
255255

256256
$groupid = 0;
257257

@@ -317,15 +317,15 @@ function _civicrm_og_sync_group_action($membership, $op = 'add') {
317317
if (function_exists('og_entity_query_alter')) {
318318
$createGroupParams = array(
319319
'og_id' => $group->nid,
320-
'title' => $group->title,
320+
'title' => substr(trim($group->title), 0, 49),
321321
// length of 49 so that the admin group can fit ': administrator' afterwards within 64 char field
322322
'name' => substr(trim($group->title), 0, 49),
323323
'is_active' => 1,
324324
);
325325
} else {
326326
$createGroupParams = array(
327327
'og_id' => $group->gid,
328-
'title' => $group->label,
328+
'title' => substr(trim($group->label), 0, 49),
329329
// length of 49 so that the admin group can fit ': administrator' afterwards within 64 char field
330330
'name' => substr(trim($group->label), 0, 49),
331331
'is_active' => 1,

0 commit comments

Comments
 (0)