Add #config_target to the admin form

Created on 23 July 2025, 14 days ago

Problem/Motivation

Since Drupal 10.2, form elements in configuration forms can use the #config_target property to indicate when their values are overridden, for example in settings.php. See https://www.drupal.org/node/3373502 .

In the Stripe API module, configuration values can be overridden using environment-specific values in settings.php. However, the admin form does not currently reflect these overrides. This can lead to confusion, as the UI displays values that do not reflect what the site is actually using.

Steps to reproduce

1. Override $config['stripe_api.settings'] in settings.php
2. Visit /admin/config/services/stripe_api.
3. Notice that there is no indication that the value is overridden.

Proposed resolution

Add #config_target to relevant form elements in the admin form, starting with those that are most likely to be overridden. This will allow Drupal to indicate when a value is being controlled outside the UI, improving clarity for administrators and developers.

With this in place, the UI will indicate that the value is overridden, helping to prevent misinterpretation of the current configuration.

Feature request
Status

Needs work

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom colinstillwell

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @colinstillwell
  • Pipeline finished with Failed
    14 days ago
    #555121
  • 🇬🇧United Kingdom colinstillwell

    I've attached a patch that adds #config_target to the mode field in the Stripe admin form.

    This change addresses a specific use case on my site, where we override $config['stripe_api.settings']['mode'] in settings.php based on the environment.

    At this stage, I have only applied the change to the mode field. This was intentional, as it's the setting relevant to my current use case. I wanted to open the conversation first and confirm that the community agrees with this approach before applying it more broadly.

    If others support this direction, I would be happy to invest more time in extending #config_target to other relevant form elements within the module.

    Looking forward to your feedback.

Production build 0.71.5 2024