Fix persist config values for custom components (#31862)

Closes #31858

Signed-off-by: Stephan Schrader <stephan.schrader@wallis.de>
Signed-off-by: Stephan Schrader <zstephanz@gmail.com>
Co-authored-by: Stephan Schrader <stephan.schrader@wallis.de>
This commit is contained in:
StephanSchrader 2024-08-07 14:40:30 +02:00 committed by GitHub
parent acbbfde4ab
commit 4d64092119
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View file

@ -1058,7 +1058,7 @@ public class RepresentationToModel {
Set<String> keys = new HashSet<>(rep.getConfig().keySet()); Set<String> keys = new HashSet<>(rep.getConfig().keySet());
for (String k : keys) { for (String k : keys) {
if (!internal && !providerConfiguration.containsKey(k)) { if (!internal && !providerConfiguration.containsKey(k)) {
break; continue;
} }
List<String> values = rep.getConfig().get(k); List<String> values = rep.getConfig().get(k);

View file

@ -229,6 +229,9 @@ public class ComponentsTest extends AbstractAdminTest {
// Check value updated // Check value updated
returned.getConfig().putSingle("val1", "one-updated"); returned.getConfig().putSingle("val1", "one-updated");
// send a key / value which not contained in the original component config
returned.getConfig().putSingle("not-a-config-key", "ten");
// Check null deletes property // Check null deletes property
returned.getConfig().putSingle("val2", null); returned.getConfig().putSingle("val2", null);