-
Notifications
You must be signed in to change notification settings - Fork 5
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
Cannot map "0" to a numeric or text field in a Civi form #3
Comments
Hunting through the code, I don't see where a zero(0) might get mapped to null. I do see that once that value is null, then the corresponding key in the params array is removed, which is why we get the message "Mandatory key(s) missing ..."
|
I removed the test_num_civi processor and just added the Auto Responder to verify that Caldera Forms interprets the "0" input correctly. It appears to be somehow being transformed in this plugin. |
For a short term fix, I can just pass characters to the Civi Form and then map to 0. I don't understand how the Map Value action works. Can someone show me an example, please? I want to map "Y" to numeric 1 and "N" to numeric 0. I also want the reverse map: 1=>"Y" and 0=>"N" for retrieving defaults. I tried guessing at the correct JSON format for the mapping, but my guesses have not worked. One simple example is all I need and this would at least give us a workaround for our current application which is on a schedule to be completed soon. |
When the number 0 (or text "0") is entered in a Caldera form, either directly in an input box, or as a value from a radio selection, 0 appears to get replaced by "null" at some point prior to running a CiviCRM Form Processor which needs this parameter. If this is an expected parameter on the Civi form processor, you get a FAIL when submitted.
I discovered this on a more complicated form, but I created a super simple example to illustrate the error. The Caldera form is named test_input_zero and is exported as test_input_zero-export.json. The Civi Form Processor that is used as a processor in test_input_zero is test_num_civi and is exported as test_num_civi.json. I zipped both exports to attach here
test_input_zero.zip. I'm also attaching a screenshot of the McRestFace Log after entering a "1" for the numeric field in test_input_zero. It is correctly passed through as input to test_num_civi processor in CiviCRM.
Entering the number 0 shows that null is passed to test_num_civi and so the processor fails as also shown in the McRestFaceLog
There is no issue with any other non-zero integer, including negative numbers, being passed through the interface. 0 just is interpreted as null for some reason. Is there a setting to prevent this?
The text was updated successfully, but these errors were encountered: