jacob_v_dam Posted January 29, 2020 Share Posted January 29, 2020 Hello, I'm trying to write a command in PrestaShop 1.7.5 which should use some data from the configuration object. I created a services.yml which registers my command, this works fine. After that I defined some arguments which should be passed to my command, this works to. But when I try to access a configuration value, the result is always null. The arguments I use are: $configuration: '@=service("prestashop.adapter.legacy.configuration")' $connection: '@doctrine.dbal.default_connection' $dbPrefix: '%database_prefix%' $context: '@=service("prestashop.adapter.legacy.context").getContext()' My command receives those arguments. But when I call $configuration->get('VARIABLE') it is null, even when it is set in the database and the old \Configuration object returns the right value. Am I missing something or should I use another configuration dependency. I tried different once, but probably not the right one. Regards, Jacob Link to comment Share on other sites More sharing options...
alreadynight Posted January 31, 2020 Share Posted January 31, 2020 Hi jacob_v_dam, I'm trying to write a command in my custom module but I have some difficulties. Can you write me here how you've written yours? I have problem configuring the namespace and composer.json file so I can't call it from console. Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now