-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Afform - support file uploads #21150
Conversation
(Standard links)
|
|
Oops. Now fixed @seamuslee001 |
@colemanw I tried testing this filling in my test form as an anon user after adding a file upload field to the Constituent Information Custom field. I kept getting a 403 on the civicrm/ajax/api4/Afform/submitFile url {
"type": "form",
"requires": [],
"title": "Test Form",
"description": "",
"is_dashlet": false,
"is_public": true,
"is_token": false,
"server_route": "civicrm/test-form-test",
"permission": "*always allow*",
"redirect": ""
} <af-form ctrl="afform">
<af-entity data="{contact_type: 'Individual', source: 'Test Form'}" url-autofill="0" type="Contact" name="Individual1" label="Individual 1" actions="{create: true, update: true}" security="FBAC" />
<fieldset af-fieldset="Individual1">
<legend class="af-text">Individual 1</legend>
<fieldset class="af-container">
<div class="af-container af-layout-inline" style="border: 1px solid #000000">
<af-field name="first_name" />
<af-field name="middle_name" />
<af-field name="last_name" />
<af-field name="birth_date" />
<af-field name="display_name" />
<af-field name="constituent_information.Test_File_Field" />
</div>
</fieldset>
</fieldset>
<button class="af-button btn-primary" crm-icon="fa-check" ng-click="afform.submit()">Submit</button>
</af-form> |
@seamuslee001 good catch. I had forgotten to declare permissions for the new "submitFile" api action. |
Adds a new API action Afform.submitFile which receives uploaded files one at a time after the form is submitted.
Tested this and worked well this time |
Overview
Support file fields as part of Afform.
Technical Details
Adds a new API action Afform.submitFile which receives uploaded files one at a time after the form is submitted.
Comments
So far this supports adding but not removing files when updating an entity.