Problem/Motivation
The Add config schema for selected chart library in the default settings issue post update function didn't properly migrate the old key library settings to the new one. It is doing $config->set('library_config', $library_config); instead of $config->set('charts_default_settings.library_config', $library_config);. It causes existing site to loose default config related to the default selected library.
Steps to reproduce
- Run
git clone https://git.drupalcode.org/project/charts.git && cd chartsto get the latest code of the chart module git checkout eec3914bto have the code previous to the introduction of the changes that is causing the issue described above- Enable the chart module and one of the library
- Navigate to the chart default settings page and customize the default library settings and save
- Run
git code checkout 5.0.xto return to the latest code of chart - Run database update
- Now if you navigate back to the chart default settings page you will notice that the library settings have been overwritten
.
Proposed resolution
Update the post update hook to use the proper new key. Use charts_default_settings.library_config instead of library_config when setting up the value. We might also need to delete the `library_config` key on existing websites that have applied the post updated change.
Remaining tasks
Patch or MR
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Issue fork charts-3310145
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
Comment #5
andileco commented