Update all remaining ConfigFormBase subclasses in Drupal core to use #config_target

Created on 1 September 2023, about 1 year ago
Updated 23 August 2024, about 1 month ago

Problem/Motivation

See plan in #3364506-103: Add optional validation constraint support to ConfigFormBase โ†’ .

This is unblocked thanks to #config_target having landed and been matured, see the change record โ†’ .

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Configurationย  โ†’

Last updated 2 days ago

Created by

๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @wim leers
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    โœจ Add optional validation constraint support to ConfigFormBase Fixed landed, so less blocked ๐Ÿ‘

    This is not hard-blocked on ๐Ÿ“Œ 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 Fixed , but the infrastructure being proposed there would make this issue simpler.

  • Assigned to phenaproxima
  • Status changed to Active about 1 year ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
  • First commit to issue fork.
  • Status changed to Postponed 12 months ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
  • Status changed to Needs work 11 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    This issue has a pretty clear goal: every form in core that extends ConfigFormBase should either have its submitForm() method removed, or minimized.

  • Merge request !5223Resolve #3384790 "Pp 1 update all" โ†’ (Open) created by phenaproxima
  • Pipeline finished with Canceled
    11 months ago
    #43402
  • Pipeline finished with Canceled
    11 months ago
    #43405
  • Pipeline finished with Failed
    11 months ago
    #43412
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
  • Status changed to Postponed 11 months ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
  • Issue was unassigned.
  • Status changed to Needs work 11 months ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    ๐Ÿ“Œ ConfigFormBase + validation constraints: support composite form elements Needs review is in โ€” this can now continue! ๐Ÿ˜Š

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    This is now more ready than ever before to be pushed forward ๐Ÿค“

  • Pipeline finished with Failed
    9 months ago
    #74514
  • Pipeline finished with Failed
    9 months ago
    #74520
  • Pipeline finished with Failed
    9 months ago
    #74526
  • Pipeline finished with Failed
    9 months ago
    #74544
  • Pipeline finished with Canceled
    8 months ago
    #80820
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    There'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()
  • Pipeline finished with Failed
    8 months ago
    #80821
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    Re #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.

    \Drupal\language\Form\NegotiationBrowserForm::submitForm()
    \Drupal\language\Form\NegotiationConfigureForm::submitForm()

    Both of these are complex, and should have their own issues.

    \Drupal\language\Form\NegotiationUrlForm::submitForm()
    This has a lot of logic in validateForm(), but the submit is easy enough.

    \Drupal\views_ui\Form\AdvancedSettingsForm::submitForm()
    We can do this one now. It's not too hard.

    \Drupal\locale\Form\LocaleSettingsForm::submitForm()
    \Drupal\update\UpdateSettingsForm::submitForm()

    These needs 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.

  • Pipeline finished with Failed
    8 months ago
    #81572
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium borisson_ Mechelen, ๐Ÿ‡ง๐Ÿ‡ช

    Does #16 mean we make this a plan and create new child issues for the more complicated ones?

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
    1) Drupal\Tests\system\Functional\Form\SiteInformationFormTest::testValidation
    Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for system.mail with the following errors: system.mail:mailer_dsn missing schema, 0 [mailer_dsn] 'mailer_dsn' is not a supported key.
    

    That 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 system module we'd be able to do everything except ThemeSettingsForm, because of ๐Ÿ“Œ Add validation constraints to `type: theme_settings` Active โ€” there's a whole dragon nest there ๐Ÿ‰๐Ÿ˜…

    What do you think, @phenaproxima?

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium borisson_ Mechelen, ๐Ÿ‡ง๐Ÿ‡ช

    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?

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    That works for me too. We'll let @phenaproxima choose which of those directions he prefers ๐Ÿค“

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium borisson_ Mechelen, ๐Ÿ‡ง๐Ÿ‡ช

    @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?

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia samit.310@gmail.com

    samit.310@gmail.com โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 154s
    #262508
  • Pipeline finished with Failed
    about 1 month ago
    Total: 464s
    #262516
  • Pipeline finished with Failed
    about 1 month ago
    Total: 156s
    #262528
  • Pipeline finished with Failed
    about 1 month ago
    #262531
  • Pipeline finished with Failed
    about 1 month ago
    Total: 834s
    #262608
  • Pipeline finished with Failed
    about 1 month ago
    Total: 554s
    #262627
  • Pipeline finished with Failed
    about 1 month ago
    Total: 748s
    #262650
  • Pipeline finished with Success
    about 1 month ago
    Total: 592s
    #262838
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia samit.310@gmail.com

    I have rebased it with latest 11.x and resolved conflicts from following files.

    • core/modules/statistics/src/StatisticsSettingsForm.php
    • core/modules/system/src/Form/SiteInformationForm.php

    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.

    1)
    Drupal\Tests\language\Functional\LanguageUILanguageNegotiationTest::testUILanguageNegotiation
    Behat\Mink\Exception\ResponseTextException: The text "In zh-hans In zh-hans
    In zh-hans" was not found anywhere in the text of the current page.
    /builds/issue/drupal-3384790/vendor/behat/mink/src/WebAssert.php:907
    /builds/issue/drupal-3384790/vendor/behat/mink/src/WebAssert.php:293
    /builds/issue/drupal-3384790/core/tests/Drupal/Tests/WebAssert.php:979
    /builds/issue/drupal-3384790/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php:433
    /builds/issue/drupal-3384790/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php:413
    FAILURES!
    Tests: 5, Assertions: 115, Failures: 1.
    

    Here is the reference link https://git.drupalcode.org/issue/drupal-3384790/-/jobs/2532792

    Thanks
    Samit K.

Production build 0.71.5 2024