-
Notifications
You must be signed in to change notification settings - Fork 26
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
State Filed population issue #177
Comments
I've run into the same issue, as discussed on the civicrm stackexchange.. I agree that the logic around the 293-297 foreach loop needs to be improved to handle the case where all countries are included by leaving the right-hand boxes for available countries and available states empty (as CiviCRM instructs). |
@rgilman Agree too. This would be a welcome improvement as the current behaviour is somewhat confusing and counter to CiviCRM's default functionality. I'll bug this one internally, find an Agileware team member to review and submit PR. Agileware Ref: CFC-71 (our internal task). |
@rgilman just FYI your workaround doesn't appear to be working anymore :( In wanting to have all countries show in Caldera Forms we had to enable each country in CiviCRM localization settings (admittedly not a nice workaround). However, in extensive testing, we found a significant slowness when using the CiviCRM State/Province field, most pronounces with all countries enabled but still sluggish with just United States. TTFB was 4.3s all countries enabled, 2.6s just United States enabled. 1.6s with solution below. If you use a select dropdown field in Caldera and bulk insert the states/provinces you want in the following format: Just export as CSV the countries you want from civicrm_state_province table and then separate with | so using the US as an example would be: 1000|Alabama |
I think I have come across an issue with the State/Province population function in the helper file. The logic is checking for the countryLimit setting from CiviCRM. Teh CiviCRM notes states that if you don't want to limit any countries, to leave the right side select field empty. But, this is causing the check on line 294 to essentially unset all state/province results from CiviCRM. It seems like there should be a check, before iterating over all of the state/province items, to see if the countryLimit is empty and if so, skip the foreach loop.
cf-civicrm/includes/class-civicrm-caldera-forms-helper.php
Line 294 in fe03d53
The text was updated successfully, but these errors were encountered: