This topic contains 2 replies, has 2 voices, and was last updated by Brad Harrison 5 years, 10 months ago.
- Topic
I’m trying to change the default Localization > Temperature Unit system value when I add a custom bundle. This is so this and other settings do not need to be manually changed whenever a new application is installed.
I’ve determined that the default value is being set within the Oro\Bundle\LocaleBundle\DependencyInjection\Configuration class:
123456789SettingsBuilder::append($rootNode,[// ...'temperature_unit' => ['value' => 'fahrenheit'],'wind_speed_unit' => ['value' => 'miles_per_hour'],// ...]);I’ve tried adding an override within my bundle hoping that it will be merged over the top:
123456789101112131415161718class Configuration implements ConfigurationInterface{public function getConfigTreeBuilder(){$treeBuilder = new TreeBuilder();SettingsBuilder::append($treeBuilder->root(\Oro\Bundle\LocaleBundle\DependencyInjection\Configuration::ROOT_NAME),['temperature_unit' => ['value' => 'celsius'],]);return $treeBuilder;}}My bundle is being loaded after the OroLocaleBundle but I’m still seeing fahrenheit as the default value:
1234$config = $this->getContainer()->get('oro_config.user');$output->writeln('Unit is: ' . $config->get('oro_locale.temperature_unit'));// Output: Unit is fahrenheightIs there something I’m missing or is this not possible?
Cheers.
Brad
The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.