[6.x] Add asset upload support to register and profile forms #12600
+143
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a follow up to #6400 and second attempt at asset upload support in the user register and profile tags.
The implementation is fairly basic, but it's the most logical approach I can think of when using simple HTML file input fields. More advanced asset management would be great (particularly when dealing with multi-asset fields), but that's beyond the scope of this PR and may be more appropriate for an addon or custom implementation.
This works as follows:
delete_replaced_profile_form_assets
false
replaced assets are unlinked but remain in the container (default)true
replaced assets are completely deleted from the containerAs HTML file inputs are always blank by default there is no way to completely clear an assets field with this basic implementation. That would require sending some kind of extra hint(s) with the form submission, or a separate endpoint.
Part of my motivation for submitting this is that I'm deprecating my Memberbox addon, and this feature is pretty much the only reason anyone uses that. I think this should cover most basic use cases (it's already better than the version in my addon).