Problem/Motivation

_file_save_upload_from_form() deletes existing Messenger errors, calls file_save_upload(), merges any new errors into one message, and restores the original errors, so callers can set a single form error. It is @internal, and #3619418: Add a service to replace file_save_upload() and deprecate it replaces the function it wraps. ManagedFile::valueCallback(), ThemeSettingsForm, locale's ImportForm, and navigation's SettingsForm all call it directly.

Steps to reproduce

Proposed resolution

Update ManagedFile::valueCallback(), file_managed_file_save_upload(), ThemeSettingsForm, ImportForm, and SettingsForm to call the new service from #3619418: Add a service to replace file_save_upload() and deprecate it directly.

For ManagedFile, build the form error from the array of FileUploadResult objects, merging violations and errors from more than one file into a single item list. For the single-file forms, call a single file upload method from #3619418: Add a service to replace file_save_upload() and deprecate it. Remove _file_save_upload_from_form() and and deprecate file_managed_file_save_upload() without replacement.

This might be blocked on #3616645: Form #value_callback does not support CallableResolver-style callables and #3616663: ElementInfoManager overwrites a form element's own #value_callback declaration

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Comments

kim.pepper created an issue. See original summary.

kim.pepper’s picture

Title: Migrate the ManagedFile element to the new upload service and remove _file_save_upload_from_form() » Migrate all callers of _file_save_upload_from_form() to the new upload service, and remove it
Issue summary: View changes

Updated IS

kim.pepper’s picture

Issue summary: View changes
kim.pepper’s picture

Title: Migrate all callers of _file_save_upload_from_form() to the new upload service, and remove it » Remove _file_save_upload_from_form() and deprecate file_managed_file_save_upload()
Issue summary: View changes
kim.pepper’s picture

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.