Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
UpdateSettingsForm
inherited from ConfigFormBase
which needs ConfigFactoryInterface
as argument but it is not set, the form works because config has fallback to global \Drupal
Proposed resolution
Call parent static create($container)
in own overridden method to comform interface and inheritance
Remaining tasks
decide on approach (comment #9) and commit
User interface changes
no
API changes
construction of form may change but constructors are not a part of BC
Data model changes
no
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#11 | interdiff-3101138-4-3101138-10.txt | 543 bytes | pratik_kamble |
#11 | 3101138-10.patch | 1017 bytes | pratik_kamble |
Comments
Comment #2
andypostFor 8.x it could use this patch to keep BC
Comment #3
andypostOr could be like that patch
Comment #4
andypostMissed return
Comment #5
andypostLooks the form missing tests (only in
core/modules/update/tests/src/Functional/UpdateCoreTest.php
it used to get)Comment #6
kishor_kolekar CreditAttribution: kishor_kolekar as a volunteer and at QED42 commentedComment #7
kishor_kolekar CreditAttribution: kishor_kolekar as a volunteer and at QED42 commentedComment #8
pratik_kamble@kishor_kolekar, Patch by @andypost is the correct way to extend classes. FYR: https://www.previousnext.com.au/blog/safely-extending-drupal-8-plugin-cl...
Comment #9
alexpottIf we're going to do this to insulate ourselves from upstream constructor changes then we need to do $instance = parent::create(); - otherwise we might as well do the patch in #6
@andypost I think that as long as we hit the route in a test then we're okay because that means the form is being constructed and so we have test coverage of the changes here.
Comment #10
pratik_kambleComment #11
pratik_kambleRerolled patch.
Comment #12
pratik_kambleComment #13
pratik_kambleComment #14
C-LogemannFixing issue tag to "ContributionWeekend2020“ as suggested on global event page.
Comment #15
longwaveLooks good to me.
Comment #16
andypostfixed summary
Comment #17
catchCommitted f737942 and pushed to 9.0.x, backported to 8.9.x
Comment #20
catchRetrospective title change...