Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
file.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 Jul 2025 at 00:21 UTC
Updated:
27 Aug 2025 at 04:44 UTC
Jump to comment: Most recent
We should deprecate the legacy file_system_settings_submit() form submit handler and move it to the only place it is used in \Drupal\file\Hook\FileHooks.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
kim.pepperComment #4
smustgrave commentedSeems like a good deprecation
Comment #5
nicxvan commentedhttps://www.drupal.org/project/drupal/issues/3514161
Here are some details, I'll try to connect with berdir and build a list of best practices.
Comment #6
kim.pepperInteresting. I'm not sure how autowired classes will work when using a classname. I was sure they were for static methods, but lets see what the tests say.
Comment #7
nicxvan commentedI'm beginning to wonder if these belong in a helper class as a static callback.
Comment #8
kim.pepperI changed this to a static method, but seems strange to me that a submit handler must be static.
Comment #9
nicxvan commentedTo be clear the concern I think berdir raises is memory usage, not whether it works.
The way you had it will work, but the whole object is stored.
Comment #10
nicxvan commentedOne final suggestion.
I think you're good to self rtbc once that is in I was about to when I noticed it was method not function.
I think the deprecation is a courtesy, it's a submit callback.
Versions are right.
Technically the use statement ordering is out of scope, but a separate issue for that is unnecessary and this change is small enough it makes sense to handle here as well.
Comment #11
kim.pepperApplied suggestion and self-RTBC as per #10
Comment #12
kim.pepperComment #14
catchCommitted/pushed to 11.x, thanks!
Comment #17
kim.pepperWe will need to update the change record once #3540101: Deprecated file_system_settings_submit() calls settingsSubmit() on wrong class is in.
Comment #18
quietone commentedI published the CR. The mistake about the class, fixed in #3540101: Deprecated file_system_settings_submit() calls settingsSubmit() on wrong class was not in a release so the CR can stay as is.