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
Comments
Comment #2
kim.pepperUpdated IS
Comment #3
kim.pepperComment #4
kim.pepperComment #5
kim.pepperThis was fixed in #3375423: Deprecate file_managed_file_save_upload(), file_save_upload() and _file_save_upload_from_form() and replace with a service