locale languageid and currencyid NULL

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
michal.fehér
Posts: 44
Joined: 05 Feb 2018, 09:57

locale languageid and currencyid NULL

Post by michal.fehér » 07 Jul 2018, 10:15

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.
Attachments
Snip20180707_16.png
Snip20180707_16.png (94.33 KiB) Viewed 2093 times
Snip20180707_15.png
Snip20180707_15.png (97.08 KiB) Viewed 2093 times
Snip20180707_21.png
Snip20180707_21.png (146.69 KiB) Viewed 2093 times

michal.fehér
Posts: 44
Joined: 05 Feb 2018, 09:57

Re: locale languageid and currencyid NULL

Post by michal.fehér » 07 Jul 2018, 10:16

the rest...
Attachments
Snip20180707_20.png
Snip20180707_20.png (116.1 KiB) Viewed 2092 times
Snip20180707_19.png
Snip20180707_19.png (97.57 KiB) Viewed 2092 times

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: locale languageid and currencyid NULL

Post by aimeos » 09 Jul 2018, 07:43

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).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

michal.fehér
Posts: 44
Joined: 05 Feb 2018, 09:57

Re: locale languageid and currencyid NULL

Post by michal.fehér » 09 Jul 2018, 10:49

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?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: locale languageid and currencyid NULL

Post by aimeos » 10 Jul 2018, 20:00

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply