Closed (fixed)
Project:
Drupal core
Version:
10.3.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
10 Oct 2023 at 23:16 UTC
Updated:
27 Mar 2024 at 20:33 UTC
Jump to comment: Most recent
Comments
Comment #2
kim.pepperPostponed on #3375447: Create an UploadedFile validator and deprecate error checking methods on UploadedFileInterface
Comment #3
larowlanBlocker is in
Comment #4
kim.pepperComment #6
smustgrave commentedMarking as move seems fine.
Only concern is will this immediately break contrib modules? See some existing tests and validations had to be updated. But not sure how to backwards check a move.
Comment #7
kim.pepperWe are subclassing the exact same code in a new namespace, so existing code should work fine, just trigger the deprecation warning. We could add a deprecation test, but we don't usually do that for constructors.
Comment #8
alexpottAdded some questions to the MR
Comment #9
kim.pepperAddressed feedback.
Comment #10
smustgrave commentedappears all feedback has been addressed.
Comment #11
alexpottI asked anothe question on the MR
Comment #12
kim.pepperAll threads resolved.
Comment #13
smustgrave commentedSeems all threads have been resolved again :)
Comment #14
xjmWe have an opportunity while doing this to add parameter and return typehints to everything that's missing them (methods, parameters, etc.). (Normally, changes to moved code might be considered out of scope, but ensuring new API additions are typehinted properly is a higher priority and does not significantly impact the scope since it's only the top level of the moved code.) Once that's done, we can also mention it in the CR.
Thanks!
Comment #15
kim.pepperComment #16
xjmComment #17
xjmComment #18
xjmSome helpful test failures, mostly for strings vs. stringables. (So I guess we either need to allow
\Stringablein addition tostringbasically, or to change existing usages to typecast.)I belatedly realized there might be some limitations in method typehinting based on the interface, but at least the constructors and member properties should be fair game for the typehint additions.
Comment #19
xjmComment #20
kim.pepperNot sure what is causing the AdminUI Javascript test fails. 😒
Comment #21
kim.pepperI missed the string type errors in the kernel tests earlier. Finally found them!
I've added a deprecation trigger for
\Drupal\Core\Validation\ConstraintViolationBuilder::atPath($path)because there were a couple of places passingintand the interface specifiesstring. Added this to the change record.We are passing
string,\Stringable, andintto\Drupal\Core\Validation\ConstraintViolationBuilder::setParameter(string $key, mixed $value). Not sure whether we should try and reduce that down to juststringand\Stringable?Comment #22
smustgrave commentedMove still seems fine
Comment #23
longwaveAdded some feedback to the MR.
Comment #24
kim.pepperComment #25
smustgrave commentedReviewed the change and appears all feedback has been addressed.
Like we added typehints for everything too.
Deprecation appears correct, CR reads well.
LGTM
Comment #26
alexpottNeeds a rebase.
Comment #27
kim.pepperRebased on 11.x
Comment #28
alexpottCommitted eacd1fa and pushed to 11.x. Thanks!
Committed 36f2784 and pushed to 10.3.x. Thanks!
Added the above code back to the 10.3.x backport so we didn't change return types.