- Issue created by @cboyden
Since version 2.2.0, storing a config override results in a PHP warning and missing link text when viewing the CSP settings form.
$config['csp.settings']['report-only']['directives']['frame-src']['base'] = 'self';
$config['csp.settings']['report-only']['directives']['frame-src']['sources'][] = 'https://www.example.com';
Warning: Undefined array key "#title" in Drupal\Core\Form\ConfigFormBase->checkConfigOverrides() (line 361 of core/lib/Drupal/Core/Form/ConfigFormBase.php).
Warning: Undefined array key "#title" in Drupal\Core\Form\ConfigFormBase->checkConfigOverrides() (line 363 of core/lib/Drupal/Core/Form/ConfigFormBase.php).
Source code of the config override warning links displayed in the status message:
<ul class="links">
<li><a href="#edit-report-only-directives-frame-src" title="'' form element"></a></li>
<li><a href="#edit-report-only-directives-frame-src-sources" title="'Additional Sources' form element">Additional Sources</a></li>
</ul>
Add the '#title' attribute to all generated settings form fields.
In addition to the missing link text, there are going to be some usability/accessibility issues if more than one similarly-named setting is overridden. All of the "additional sources" overrides in the status message will have the same link text, for example. It will be hard for site admins to know which values are actually overridden. So it would be nice to have some text to disambiguate the fields.
In the 2.0.x version of the CSP module, overrides were output as a dump of YAML-like text, which was hard to read but if you looked carefully you could see the hierarchy of config key names.
Update and test.
None.
None.
None.
Active
2.0
Code