Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
update_variables_to_config loses data when called on an existing config
with numeric keys. One such example is system.site -> page.403
Even if a completely unrelated key is updated with update_variables_to_config
the value of page.403 is lost. The reason for this is that update_variables_to_config
merges the default values with the stored ones and PHP renumbers any
numeric keys starting from 0.
I will attach a test that demonstrates the issue.
Comment | File | Size | Author |
---|---|---|---|
#1 | demonstrate-fail-on-numeric-keys-1830424-1.patch | 1.71 KB | cspitzlay |
Comments
Comment #1
cspitzlayHere is the test.
BTW: String keys work alright.
Comment #2
cspitzlayComment #4
webflo CreditAttribution: webflo commented#1: demonstrate-fail-on-numeric-keys-1830424-1.patch queued for re-testing.
Comment #6
aspilicious CreditAttribution: aspilicious commentedI believe there is an issue for this already (with a solution)
Comment #7
cspitzlayI found the issue: #1825466: Allow NestedArray::mergeDeepArray() to preserve integer keys