-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Description
Steps.
- Install a package with config
- Publish the config to your app config.
- When Laravel attempts to merge the config from the original package settings, with the settings found in your app, some elements are appended instead of being replaced.
Update: Looks like the same problem happens when merging environment specific config over the base config. Basically, config_merge()
behaves very differently from array_merge()
that was used before. The new behaviour does not appear to be correct
For example.
Config in package
return [
'enabled' => [
'first',
'second'
]
]
Published (and edited) config from your apps config/packages/vendorname/packagename
return [
'enabled' => [
'alpha',
'beta'
]
]
Expected array when you fetch 'enabled' from the config...
return [
'enabled' => [
'alpha',
'beta'
]
]
Actual array you get when you fetch 'enabled' from the config
return [
'enabled' => [
'first',
'second'
'alpha',
'beta'
]
]
Notice that the items in the 'enabled' array are appended. This appears to happen in config_merge() and differs from 4.2. It only effects config items that contain an array with a numeric index.
This was fine about a week ago. I think it relates to this commit...
5122ea0
I noticed this problem using the package rcrowe/twigbridge. It's extensions.php config file means you can no longer remove packages you don't want, only add additional packages to those declared in the default package config.