Juhas0 Posted January 23, 2017 Share Posted January 23, 2017 Hi, I cannot find this simple information anywhere. I am writing a module and want to get default language id. My getContent method looks like that (part of code): public function getContent() { $output = null; if(Tools::isSubmit('addregfield')) { //display for for the user so he can enter data return $output.$this->displayForm(); //here I get actual lang id using (int)Configuration::get('PS_LANG_DEFAULT'); } if (Tools::isSubmit('addfield'.$this->name)) //form after submit { //here Configuration::get('PS_LANG_DEFAULT') ALWAYS returns NULL } } As you can see if form was submitted, Configuration ALWAYS returns NULL. Why is that? I'm fighting with it for 2 hours. And the only thing I came up with was to create hidden field in my form (using HelperForm) and then read this value. But I'm nearly sure that this method is bad. So, how to do this properly? Link to comment Share on other sites More sharing options...
Juhas0 Posted January 23, 2017 Author Share Posted January 23, 2017 OK this was bug in my debugger :| It was showing NULL value, although Configure::get is returning valid value. You can close or delete this topic. 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