Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
herbdool opened this issue Apr 3, 2023 · 6 comments · May be fixed by #5

Comments

@herbdool
Copy link

herbdool commented Apr 3, 2023

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.

@herbdool herbdool changed the title In resulting webforms with existing contact component getting bug "One of parameters (value: ) is not of the type CommaSeparatedIntegers" In resulting webforms with existing contact component getting error: "One of parameters (value: ) is not of the type CommaSeparatedIntegers" Apr 3, 2023
@herbdool
Copy link
Author

herbdool commented Apr 3, 2023

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.

@stesi561
Copy link
Member

stesi561 commented Apr 3, 2023

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.

@herbdool
Copy link
Author

herbdool commented Apr 3, 2023

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.

herbdool added a commit to freeform/webform_civicrm_migrate that referenced this issue Apr 3, 2023
herbdool added a commit to freeform/webform_civicrm_migrate that referenced this issue Apr 4, 2023
@herbdool
Copy link
Author

herbdool commented Apr 4, 2023

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

@jitendrapurohit
Copy link
Contributor

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.

@stesi561
Copy link
Member

Closing in favour of #5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants