Needs work
Project:
Drupal core
Version:
main
Component:
configuration system
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Sep 2023 at 12:09 UTC
Updated:
23 Aug 2024 at 15:04 UTC
Jump to comment: Most recent
Comments
Comment #2
wim leers#3364506: Add optional validation constraint support to ConfigFormBase landed, so less blocked 👍
This is not hard-blocked on #3382510: Introduce a new #config_target Form API property to make it super simple to use validation constraints on simple config forms, and adopt it in several core config forms, but the infrastructure being proposed there would make this issue simpler.
Comment #3
wim leersComment #4
wim leersComment #6
wim leersComment #7
phenaproxima#3382510: Introduce a new #config_target Form API property to make it super simple to use validation constraints on simple config forms, and adopt it in several core config forms was committed to 11.x, so we can proceed here.
Comment #8
phenaproximaComment #9
phenaproximaThis issue has a pretty clear goal: every form in core that extends ConfigFormBase should either have its submitForm() method removed, or minimized.
Comment #11
wim leersApparently this is hard-blocked on #3398982 per @phenaproxima in #3398982-10: ConfigFormBase + validation constraints: support non-1:1 form element-to-config property mapping again.
Comment #12
wim leersComment #13
wim leers#3398982: ConfigFormBase + validation constraints: support non-1:1 form element-to-config property mapping again is in — this can now continue! 😊
Comment #14
wim leersThis is now more ready than ever before to be pushed forward 🤓
Comment #15
wim leersThere's one last property path left in
\Drupal\system\Form\SiteInformationForm::submitForm()🤓Also still left:
\Drupal\language\Form\NegotiationBrowserForm::submitForm()\Drupal\language\Form\NegotiationConfigureForm::submitForm()\Drupal\language\Form\NegotiationUrlForm::submitForm()\Drupal\locale\Form\LocaleSettingsForm::submitForm()\Drupal\system\Form\ThemeSettingsForm::submitForm()\Drupal\update\UpdateSettingsForm::submitForm()\Drupal\views_ui\Form\AdvancedSettingsForm::submitForm()Comment #16
phenaproximaRe #15: most of those forms have very complicated validation and submit logic, and I'm not sure how extensively they're tested, or even if they're tested. I'm therefore very hesitant to even attempt all of those complex conversions in this one issue, lest I break stuff.
Both of these are complex, and should have their own issues.
\Drupal\language\Form\NegotiationUrlForm::submitForm()The
submitForm()looks simple, but it's actually saving a tree of elements. There's also a lot going on invalidateForm(). This deserves its own issue.\Drupal\views_ui\Form\AdvancedSettingsForm::submitForm()We can do this one now. It's not too hard.
These need to remain as they are. Neither is doing any config mappings, but they are doing legitimate cache clears as needed. That's a proper use of a
submitForm()override.\Drupal\system\Form\ThemeSettingsForm::submitForm()This should be done in its own issue because it's very complicated due to the dynamism of theme settings.
Comment #17
borisson_Does #16 mean we make this a plan and create new child issues for the more complicated ones?
Comment #18
wim leersThat key does exist. I wonder what's going on here. 🤔
#17: There's a lot of work/progress in this issue already. But I think you're right: it'd be clearer to turn this into a meta/plan issue and then create a child issue per … module? For the
systemmodule we'd be able to do everything exceptThemeSettingsForm, because of #3416178: Add validation constraints to `type: theme_settings` — there's a whole dragon nest there 🐉😅What do you think, @phenaproxima?
Comment #19
borisson_Scoping is always difficult, but I'd suggest we create one issue for the easier ones (the issue we currently have basically), and create followups per form?
Comment #20
wim leersThat works for me too. We'll let @phenaproxima choose which of those directions he prefers 🤓
Comment #21
borisson_@phenaproxima, what do you think is the best option here? Do we want to turn this in a meta or do we want to create followups?
Comment #23
samitk commentedI have rebased it with latest 11.x and resolved conflicts from following files.
Also reverted the code of core/modules/language/src/Form/NegotiationSessionForm.php file back to 11.x, because getting following error due to failing test cases.
Here is the reference link https://git.drupalcode.org/issue/drupal-3384790/-/jobs/2532792
Thanks
Samit K.