When creating (or saving) a custom data group or (field)set the following error pops up:
Notice: Undefined offset: 0 in webform_civicrm_civicrm_postSave_civicrm_custom_group() (line 436 of /home/unidosnow/www/www/sites/all/modules/webform_civicrm/webform_civicrm.module)
The code throwing this:
/**
* Implements hook_civicrm_postSave_tableName().
*
* Handles adding/editing a custom group.
*
* @param CRM_Core_DAO_CustomGroup $dao
*/
function webform_civicrm_civicrm_postSave_civicrm_custom_group($dao) {
module_load_include('inc', 'webform', 'includes/webform.components');
// get all fieldsets with custom group ID
$customGroupId = $dao->id;
$dbResource = db_query("SELECT * FROM {webform_component} WHERE type ='fieldset' "
. "AND form_key LIKE '%cg{$customGroupId}_fieldset'");
$fieldsets = $dbResource->fetchAll(PDO::FETCH_ASSOC);
// check if dao fields have been fetched
if (!$dao->title) {
$dao->find(TRUE);
}
// run only if the title of the custom group has changed in civicrm
-->> if ($fieldsets[0]['name'] != $dao->title) { <<-- Exception here
foreach ($fieldsets as $field_info) {
$component = array();
$component['name'] = $dao->title;
$component['type'] = $field_info['type'];
$component['form_key'] = $field_info['form_key'];
$component['weight'] = $field_info['weight'];
$component['nid'] = $field_info['nid'];
$component['cid'] = $field_info['cid'];
$component['pid'] = $field_info['pid'];
webform_component_update($component);
}
}
}
The custom set creates successfully, haven't yet tried to use it in a webform. Before the 4/25 update I had created custom data sets without this error. Don't have record of the versions I was using at the time, the current versions that show the problem are CiviCRM 4.7.29, Drupal Core 7.59, webform-civicrm 4.20, and webform 4.17.