fuzionnz/webform_civicrm_migrate

In resulting webforms with existing contact component getting error: "One of parameters (value: ) is not of the type CommaSeparatedIntegers"

herbdool opened this issue · 6 comments

I think this is just related to the Existing Contact" component which I'm assuming gets populated when adding the webform_civicrm handler.

CRM_Core_Exception: One of parameters (value: ) is not of the type CommaSeparatedIntegers in CRM_Utils_Type::validate() (line 469 of /app/vendor/civicrm/civicrm-core/CRM/Utils/Type.php).
Civi\Api4\Service\Spec\Provider\EntityTagFilterSpecProvider::getTagFilterSql(Array, '`a`.`id`', 'IN', Array, Object, 0) (Line: 593)
Civi\Api4\Query\Api4SelectQuery->createSQLClause('`a`.`id`', 'IN', Array, Array, 0) (Line: 569)
Civi\Api4\Query\Api4SelectQuery->composeClause(Array, 'WHERE', 0) (Line: 464)
Civi\Api4\Query\Api4SelectQuery->treeWalkClauses(Array, 'WHERE') (Line: 304)
Civi\Api4\Query\Api4SelectQuery->buildWhereClause() (Line: 156)
Civi\Api4\Query\Api4SelectQuery->getSql() (Line: 171)

For civicrm_contact component, there are a bunch of default entries that have properties with empty keys.

'#no_autofill':
        '': ''

I think it's only complaining about #tag but we need to make sure each property should be like '#no_autofill': { } instead.

I should add this is probably a problem with webform_civicrm which probably doesn't appear because it's not normally in a migration script. So this could alternatively be fixed there, but would be quicker here.

Can I just double check if you saw the above with or without -> 122b24b

My recollection was we create a new webform enable civicrm and save it to get all the default options set.

If you are still seeing this - could you create a minimal example which highlights the issue. Thanks.

I just realized the issue is with migrateWebformElementCiviCRMContact() which is setting some of the defaults as ['' => '']. As I mentioned above the fatal error traces to Civi\Api4\Service\Spec\Provider\EntityTagFilterSpecProvider::getTagFilterSql() so I don't know if it's just a problem with 'tag' => ['' => ''], or more.

I'm not clear of the necessity of having array elements with empty keys so I've tested it with just using an empty array. This avoids the fatal error at least.

Here's a PR for just this issue: #5

This fatal error mentioned in the description should not occur if you have colemanw/webform_civicrm#837 fix included.

#5 looks fine as well. Empty arrays like these should not be included in the yml source.

Closing in favour of #5