News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

setdbLanguageTag() creates no vmlangSef Update 3.0.12 -> 3.0.14

Started by Thomas Kuschel, March 22, 2016, 17:38:13 PM

Previous topic - Next topic

Thomas Kuschel

Hi,
during the update from 3.0.12  to 3.014 the function setdbLanguageTag() line 948 throws a notice "Notice: Undefined index: en-GB in /xxxx/administrator/components/com_virtuemart/helpers/config.php on line 948" on the backend
maybe, I reckon on my website, the frontend languages (content) are en-US (default), de-DE, fr-FR, zh-TW, and zh-CN; the language en-GB is installed but disabled!
Now the function on line 946 e.i. $languages = JLanguageHelper::getLanguages('lang_code'); only gets the active languages from frontend, and on the next line fetches en-GB; because on my backend the default is en-GB.
on line 948 e.i. self::$vmlangSef = $languages[$ltag]->sef; there is no defined array index yet. -> the self::$vmlangSef gets NULL.
To get rid off the error notices, I put an @ in front of this line 948; but the self::$vmlangSef is still set wrong;
HOWTO get this bug:
You can check this behaviour; just install language en-US and disable the en-GB on the "content languages" tab in the backend. Switch to default "en-US" on the "installed languages" page in Joomla.
BR
Thomas OE1TKT

Versions: Joomla 3.5; VM 3.0.14; PHP 5.6.17

Milbo

Quote from: Thomas Kuschel on March 22, 2016, 17:38:13 PM
HOWTO get this bug:
You can check this behaviour; just install language en-US and disable the en-GB on the "content languages" tab in the backend. Switch to default "en-US" on the "installed languages" page in Joomla.

I would never do this. From my point of view it is your language setup, which is not correct.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Thomas Kuschel

Hi Max,
> From my point of view it is your language setup, which is not correct.
No, the setup is IMHO correct, we use the US language for our content, the language settings at the backend is kept original. I've no idea why this should be incorrect.
In our concern, we publish American English, default path in Joomla is British, that work before 3.0.14

Happy Easter!
Thomas

Milbo

Quote from: Milbo on March 23, 2016, 09:11:54 AM
Quote from: Thomas Kuschel on March 22, 2016, 17:38:13 PM
HOWTO get this bug:
You can check this behaviour; just install language en-US and disable the en-GB on the "content languages" tab in the backend. Switch to default "en-US" on the "installed languages" page in Joomla.

I would never do this.

The fallback works on en-Gb. Maybe it is enough to uncheck the language fallback in the vm config.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Thomas Kuschel

hi,
I unchecked that line in the vm conf, but this didn't change that behavior,
I've no time for this bug at the moment; but I will remember and I'll suggest a solution.
Indeed, it only fails in the backend,
Tom

Milbo

What happens, when you just install the en-GB again for the BE?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Thomas Kuschel

#6
QuoteWhat happens, when you just install the en-GB again for the BE?
thank you for your respond Milbo, 6 languages are installed, also the en-GB, but the language en-GB is disabled in frontend only, so the array $languages gets no array item with Joomla default language en-GB.
The functionality is okay, virtuemart works, only a notice is thrown because the self::$vmlangSef = $languages[$ltag]->sef; has no valid array of $language['en-GB']; this problem only exists when entering the backend with en-GB language, and it is the default one here.

I added a @ in front of this line: @self::$vmlangSef = $languages[$ltag]->sef;; and the notice is gone.
Note: In Joomla, you can't disable languages for backend; and the en-GB is a must to have!
I can live with this change in VM core.
Thomas