symfony/symfony — Issue #2823: useAttributeAsKey and fixXmlConfig also apply to non-XML config files
Author: Seldaek
Created: 2011-12-09 10:59:16+00:00
State: open
Labels: Config

It was my understanding that those two functions only applied when loading xml config files. It seems however that they always apply.

I had this in my twig globals:

twig:
globals:
foo: { key: bar }

I would expect to be able to read `foo.bar` in my twig templates, but it instead maps `bar` to an empty array, since the twig config contains:

$rootNode
->fixXmlConfig('global')
->children()
->arrayNode('globals')
->useAttributeAsKey('key')

I don't know the internals of that component well enough to know if it's fixable, but IMO those xml-specific hacks should not produce unexpected results in other config formats.