When you add a Component (textfield, textarea, ...) for the first time the code trys to get a new Cid from the table. But when there are no records in the table he gets null. and the query to enter a record in the table fails because 'cid' can't be null. I fixed it to check if 'cid' is null I define 'cid' as 1.
Webform.components.inc - line 614
if (!isset($component['cid'])) {
$next_id_query = db_select('webform_component')->condition('nid', $component['nid']);
$next_id_query->addExpression('MAX(cid) + 1', 'cid');
$component['cid'] = $next_id_query->execute()->fetchField();
if($component['cid'] == null){
$component['cid'] = 1;
}
}
Comments
Comment #1
quicksketchThanks, I already fixed this as part of #712324: Convert Select and Grid Options to New Data Storage.