Problem/Motivation
Cleanup File core module from deprecated functions
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3432882
Show commands
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:
- 11.x
compare
- 3432882-removed-deprecated-code
changes, plain diff MR !7148
Comments
Comment #3
satane commentedCleanup all deprecated calls, except those in *Test.php files.
Not sure if classes related to "Tests legacy deprecated functions in file.module." should just be totally deleted or left there?
Comment #4
satane commentedMerging pipeline made obvious we had to clean Test classes and even entirely delete Legacy ones, so there.
That said, there are still some unit testing errors which I can't figure out entirely.
There's still a call to a function isValid() which I removed as it was marked as deprecated.
See core/modules/file/src/Upload/FileUploadHandler.php:195
But now unit testing shows plenty of errors.
I'm stopping here for now, feel free to jump in.
Comment #5
smustgrave commentedPossible the deprecation was tested and those tests would need to be removed too.
But if removing this function breaks things we may need to re-look at if some replacements were missed when it was first deprecated
Comment #7
kim.pepperI've cleaned up some the left over deprecation code. However, I think I've hit a bug with the Validatable config job.
Unable to install modules: module 'help_topics' is obsolete.Comment #9
andypostAdded fix to see if test will pass, probably it needs separate issue (follow-up) after #3433019: Replace deprecated help_topics module with obsolete stub
but still not clear why nobody reported this earlier
Comment #10
kim.pepper#9 created a separate issue #3436055: Validatable config should skip obsolete modules
Comment #11
kim.pepperComment #12
smustgrave commentedRemoval appears complete.
Applied the MR and searched core/module/file folder for deprecated and 11.0 and all instances have been removed.
Comment #13
longwaveThanks for working on this - looking good, just a couple of missed spots.
Comment #14
kim.pepperAddressed feedback.
Coming back to this after a long while, I am wondering why we didn't deprecate
hook_file_validate()at the time?Comment #15
smustgrave commentedAppears feedback from @longwave has been addressed.
Comment #16
kim.pepperCreated #3437514: Deprecate hook_file_validate() API docs
Comment #17
alexpottThis should remove hook_file_validation from file.api.php .... it is deprecated we do
And this change is removing that line so the hook is no longer trigger so it should remove it from file.api.php.
Comment #18
kim.pepperRemoved
hook_file_validate()and doc references to callingfile_validate()Comment #19
andypostback to RTBC
Comment #20
alexpottCommitted 08c0efd and pushed to 11.x. Thanks!
Comment #22
alexpottWe need to revert this as the changes made in #3375447: Create an UploadedFile validator and deprecate error checking methods on UploadedFileInterface need a rework prior to 10.3.0 being released.
Comment #24
kim.pepperThis is unblocked now that #3437623: \Drupal\file\Upload\FileUploadHandler::handleFileUpload() should alway check that the uploaded file is valid is in.
Comment #25
catchComment #26
kim.pepperCleaned up after a few merge conflicts.
Comment #27
quietone commentedComment #28
longwaveMissed one, otherwise this looks good to me:
Comment #30
quietone commentedComment #31
andypostexcept nitpick (fixed myself) I find it RTBC
Comment #32
smustgrave commentedWas about to do the same beat me to it! Tests all green and deprecation appears to be removed here.
Comment #34
catchCommitted/pushed to 11.x, thanks!
Comment #35
kim.pepperMR needs to be closed.
Comment #38
kim.pepperWe missed a few methods on
\Drupal\file\Upload\InputStreamUploadedFileCreated #3446967: [11.x] Remove deprecated methods in InputStreamUploadedFile
Comment #39
claudiu.cristeaAny change record here?
Comment #40
kim.pepperI don't believe we need change records for removing deprecated code in major version updates.