Settings form is not accessing config correctly.

Created on 18 August 2023, almost 2 years ago
Updated 23 October 2023, over 1 year ago

Problem/Motivation

In the settingsForm which is a child of ConfigFormBase, \Drupal\siteimprove\Form\SettingsForm::buildForm is not access config correctly for the settings form as described in Working with Configuration Forms

It is currently calling the configFactory to get the config. Which is fine except is it allow overriden values to be saved in config when depending on how these are set these could be loaded from secrets depending on the system.

Steps to reproduce

in yours settings.php add the following lines.

$config['siteimprove.settings']['api_username'] = 'xxx';
$config['siteimprove.settings']['api_key'] = 'xxx';

Proposed resolution

on the settings form on line 108 which is

    $config = $this->configFactory->get('siteimprove.settings');

this needed to be changed to

    $config = $this->config('siteimprove.settings');

Now the value which is stored in config will display and not the overriden values.

For the API checked we will need to get the values from the real config factory so that they can be run.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇦🇺Australia gordon Melbourne

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

Comments & Activities

Production build 0.71.5 2024