Page 1 of 1

locale languageid and currencyid NULL

Posted: 07 Jul 2018, 10:15
by michal.fehér
Hi. Any idea why values of $this->getContext()->getLocale() has languageid and currencyid NULL while bdata contains this data? I am attaching also local DB tables data.

Re: locale languageid and currencyid NULL

Posted: 07 Jul 2018, 10:16
by michal.fehér
the rest...

Re: locale languageid and currencyid NULL

Posted: 09 Jul 2018, 07:43
by aimeos
Depends on the environment. If you are in a job controller that is executed via CLI, language and currency are NULL because you have to loop over the available sites and set the locale depending on the current site (at least most of the time).

Re: locale languageid and currencyid NULL

Posted: 09 Jul 2018, 10:49
by michal.fehér
Yes, it's in controller called via CLI (product import -> Text processor).

How do these lines work then?

Code: Select all

if( !isset( $list['text.languageid'] ) ) {
	$list['text.languageid'] = $this->getContext()->getLocale()->getLanguageId();
}
will this ever be populated if it's NULL?

Re: locale languageid and currencyid NULL

Posted: 10 Jul 2018, 20:00
by aimeos
Well, they doesn't work at all. Somebody wanted to do something good but it doesn't work as expected like you mentioned. We will remove that lines and you have to add the languageid to a column of your import file.