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.
This is part of #1924990: [meta] Convert all of system_config_form() to SystemConfigFormBase
Problem/Motivation
More consistent use of SystemConfigFormBase
Proposed resolution
Convert it to use SystemConfigFormBase
Remaining tasks
Write patch
Comment | File | Size | Author |
---|---|---|---|
#13 | before.png | 38.91 KB | xjm |
#13 | after.png | 34.31 KB | xjm |
#10 | forum-system-config-base-1925252.10.interdiff.txt | 1.08 KB | larowlan |
#10 | forum-system-config-base-1925252.10.patch | 5.9 KB | larowlan |
#8 | forum-system-config-base-1925252.8.interdiff.txt | 2.53 KB | larowlan |
Comments
Comment #1
larowlanWaiting on #1921996: Convert system_config_form() to implement FormInterface as a base class. and #1925140: drupal_form_submit() does not accept FormInterface objects
Comment #2
larowlanThis now unblocked
Comment #3
larowlanlets see how this goes
Comment #4
Kars-T CreditAttribution: Kars-T commentedThe patch just wraps the ForumSettingsForm in an object and uses symfony routing. This results in cleaner and better code.
I applied the patch and checked the functionality. Everything seems to work and I'd say it is RTBC.
The problem is there doesn't seem to be any tests for the functionality controlled by this form. So I can't easily confirm this patch doesn't change anything. I'd say we need tests for this. Or maybe the whole functionality could / should be moved to views?
Comment #5
tim.plunkettThis needs to be rerolled to take advantage of the recent improvements to forms. See #1924990-5: [meta] Convert all of system_config_form() to SystemConfigFormBase
Comment #6
Kars-T CreditAttribution: Kars-T commentedHi Tim
I think it already uses the new version?
Comment #7
tim.plunkettAll of this can go away, and just have _form: 'Drupal\forum\ForumSettingsForm' in the YAML file.
Comment #8
larowlanRefactor to take into account new _form system
Comment #9
amateescu CreditAttribution: amateescu commentedThe page callback is not necessary anymore, this should change to: 'route_name' => 'forum_settings'. And you can remove the access callback as well.
:)
Comment #10
larowlanThis shouldn't have been major, the META is major.
Comment #11
amateescu CreditAttribution: amateescu commentedLooks good now.
Comment #12
xjm#10: forum-system-config-base-1925252.10.patch queued for re-testing.
Comment #13
xjmTested manually -- looks great. Submissions work fine.
Before:
After:
(Note: the different values are from me testing the submission.) ;)
Comment #14
webchickLooks good!
Committed and pushed to 8.x. Thanks!