Problem/Motivation
In some circumstances, the dependency array in generated .info.yml files can be keyed by (non-sequential) integers.
Steps to reproduce:
- Create a new bundle and configure it to include an install profile.
- Ensure the 'profile' assignment plugin is enabled.
- Generate the feature named for the install profile and examine its .info.yml file. Note that the dependencies (which are the result of merging in the standard profile's dependencies) are keyed by integers.
This issue can be traced to FeaturesManager::arrayMergeUnique(), which retains keys in merging arrays.
Proposed resolution
Convert existing public method FeaturesManager::arrayMergeUnique() into inf-specific ::mergeInfoArray(), using NestedArray::mergeDeep().
API changes
Removed FeaturesManager::arrayMergeUnique(), replaced with ::mergeInfoArray().
Comments
Comment #2
mpotter commentedWe need a way to reproduce this one.
Comment #3
nedjoAdded steps to reproduce to summary.
Comment #4
nedjoComment #6
nedjoComment #7
nedjoGetting duplicate values for dependencies after regenerating a feature.
Cause:
NestedArray::mergeDeep()produces duplicate values when merging a non-associative array, so it addresses the numeric key issue but doesn't work for our use case.Comment #8
nedjoThis may work, but feels like a hack.
Comment #10
nedjoGood enough I guess.