FormBuilder: Form with required "Existing Contact" can't be submitted
Overview
If you put an "Existing Contact" field on a FormBuilder form, and make it required, you can't submit the form.
Reproduction steps
- See above. Here is sample HTML/JSON for a simple case:
{
"type": "form",
"title": "EntityRef required test",
"icon": "fa-list-alt",
"server_route": "civicrm/entityref-req",
"permission": "access CiviCRM",
"create_submission": true,
"requires": [],
"description": "",
"is_dashlet": false,
"is_public": false,
"is_token": false,
"entity_type": null,
"join_entity": null,
"contact_summary": null,
"summary_contact_type": null,
"redirect": null,
"navigation": null
}
<af-form ctrl="afform">
<af-entity data="{contact_type: 'Organization', source: 'EntityRef required test'}" type="Contact" name="Organization1" label="Organization 1" actions="{create: true, update: true}" security="RBAC" />
<fieldset af-fieldset="Organization1" class="af-container" af-title="Organization 1">
<div class="af-container">
<af-field name="id" defn="{required: true, input_attrs: {}}" />
</div>
</fieldset>
<button class="af-button btn btn-primary" crm-icon="fa-check" ng-click="afform.submit()">Submit</button>
</af-form>
Current behaviour
Form Error
Please fill all required fields.
Expected behaviour
Form is submitted if the field is populated.