Deprecate file_managed_file_submit form submit handler and move to \Drupal\file\Element\ManagedFile

Created on 3 July 2025, 6 days ago

Problem/Motivation

We should deprecate the legacy file_managed_file_submit() form submit handler and move to the only place it is used in \Drupal\file\Element\ManagedFile.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component

file.module

Created by

๐Ÿ‡ฆ๐Ÿ‡บAustralia kim.pepper ๐Ÿ„โ€โ™‚๏ธ๐Ÿ‡ฆ๐Ÿ‡บSydney, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @kim.pepper
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia kim.pepper ๐Ÿ„โ€โ™‚๏ธ๐Ÿ‡ฆ๐Ÿ‡บSydney, Australia
  • Pipeline finished with Failed
    6 days ago
    Total: 682s
    #538649
  • Pipeline finished with Success
    6 days ago
    Total: 886s
    #538733
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kulpratap2002

    I have applied the MR on a fresh Drupal 11.x site and confirmed the following through the UI:

    • Created a content type with a File field and tested upload and remove functionality. Everything worked as expected.
    • Repeated the test with an Image field โ€” both upload and remove actions work correctly.
    • Verified behavior for single and multi-value fields.
    • Tested required field validation by removing the uploaded file โ€” validation triggers as expected.
    • Confirmed no errors in the PHP logs or JavaScript console.
    • Verified that file_managed_file_submit() is now deprecated and the logic is moved to \Drupal\file\Element\ManagedFile::submit(), maintaining BC correctly.
    • Everything works as expected, and the code looks clean and standards-compliant.

    Marking this issue RTBC.

    Thanks!

Production build 0.71.5 2024