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.

Issue fork stripe_api-3537659

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

colinstillwell created an issue. See original summary.

colinstillwell’s picture

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.

grasmash’s picture

Status: Needs work » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

  • grasmash committed 8784c424 on 4.0.x
    Issue #3537659: Add #config_target to admin form fields
    
    - Add #...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.