Duplicating parameters on config/services.yaml when the parameter already exists in the file.
Example:
parameters:
locale: pt # original parameter
locale: en # parameter added after install
What exactly do you mean? Which steps did you perform to end up with this result?
On my case was after installing translator for the first time, the parameter was there then after install was duplicated
@xabbuh
git clone https://github.com/novosga/novosga
cd novosga
git reset --hard 472c03bc6639b5aa2225902cfd5d852fc2f4d93c
composer install
Output error:
!!
!! In FileLoader.php line 168:
!!
!! The file "/tmp/novosga/config/services.yaml" does not contain valid YAML in
!! /tmp/novosga/config/services.yaml (which is loaded in resource "/tmp/novos
!! ga/config/services.yaml").
!!
!!
!! In YamlFileLoader.php line 642:
!!
!! The file "/tmp/novosga/config/services.yaml" does not contain valid YAML.
!!
!!
!! In Parser.php line 343:
!!
!! Duplicate key "locale" detected at line 5 (near "locale: 'en'").
!!
!!
!!
ContainerConfigurator indeed does not check for existing keys in parameters
Also, if the config/services.yaml does not have the parameters key, it is not configured either.
@fabpot could we add the Yaml component dependency to Flex?
No, Flex cannot depend on YAML as this is a plugin (and anyway, I don't want to mess up with the comments and indentation). For this bug, should not be a problem now that we have the lock in place (as a recipe won't be installed more than once).
Anyway, as I've tried to make configurator idempotent as much as possible, it's worth fixing this bug. Should be relatively easy (does not need to be 100% fullproof, so just checking for the presence of \s+locale\: in the file should be enough).
Okay, I'm trying to fix this bug now.
Do you agree to add the parameters: key if it does not exists in the whole file?
Yes. Thanks for working on this.