Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.4.5, 4.5
-
Fix Version/s: 4.5
-
Component/s: Core CiviCRM
-
Labels:None
Description
Discovered in a profile with 32 fields used for event registration. The presenting symptom was that, upon submitting the form with the checkbox checked (as is the default), the user would get these messages:
- Street Address is a required field
- Postal Code is a required field
The field name may vary depending on the specifics of your configuration. If you uncheck the box, you'll find that some but not all of the billing details have been copied from the address in the profile.
The JavaScript that controls this behavior is located in templates/CRM/Core/BillingBlock.tpl. A Smarty variable is used to specify the address fields to track changes on. This variable is defined in CRM_Event_Form_Registration_Register->buildQuickForm(), based on the results of CRM_Core_BAO_UFField::assignAddressField(). The latter makes an API call, and the results are capped at 25.
While this code may benefit from some refactoring (e.g., do we really need to call uf_field.get for each field in the profile?), a quick solution to the problem is to explicitly override the API's default limit.