The issue of prodOnlyWLang hidden config in VM 3.2.2

Started by Miku, May 18, 2017, 12:41:54 PM

Previous topic - Next topic

Miku

Hi,

I see an issue with prodOnlyWLang setting. It doesn't work any longer. By 'any longer" I mean that it stopped to work after update from VM 3.0.18

I can still see it in VM manual so it should work:
https://docs.virtuemart.net/manual/general-concepts/206-hidden-configurations.html

Looking a way to find the solution I came across to new features in the language settings:

No Fallback   
Dual Fallback


Playing around with these option it looks like 'Dual Fallback' forces VM to display products also in other language (multilanguage shop) even though it was not translated.

What about this 'No Fallback'? I can't find any clarification of that feature. Does it have any use in multilanguage shop? I mean, when I use this option the product is not published at all when translation for only one language is made.  Does it mean that 'No Fallback' must be used when we have only single languange shop? Or 'No Fallback' can help to display products with no fallback for the other language? If it can, how to do that?

Looking for any feedback in that matter.
Thanks in advance

Milbo

prodOnlyWLang is the "No Fallback" and also the reason that we have checkboxes there and not a radio, which would makes more sense. Because the options are of course excluding the other. The Dualfallback is only for shops with 2 languages and uses always the other language as fallback.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Miku

Quote from: Milbo on May 18, 2017, 15:02:28 PM
prodOnlyWLang is the "No Fallback"
If so, do we still need to use "prodOnlyWLang" in config? Or "No Fallback" is a replacement of "prodOnlyWLang"?.

Regardless the answer is, it looks like "No Fallback" doesn't work. Whatever the setting is

"No Fallback"- YES /"prodOnlyWLang" - YES
"No Fallback"- YES /"prodOnlyWLang" - NO


There's no option to set a product in just one language.

Moreover, I can see two different behaviours of the system in case of ONLY "No Fallback" usage, depending on the language set in the J! Administrator, so when:

1. Administrator's language is Polish (default language site)  "No Fallback" doesn't work at all. Even though we set a product in just the primary language it displays in both.
2. Administrator's language is English  - we can observe some effect of "No Fallback" activation, but I guess not the intended one. I mean that the product is not display at all. In none of the languages.
Mentioning about
Quote"some effect of "No Fallback" activation"
I ment that when we set the Administrator's language back to Polish we could see something like "Language Missing id 568"

What can be wrong?

Milbo

Quote from: Miku on May 19, 2017, 08:01:32 AM
Quote from: Milbo on May 18, 2017, 15:02:28 PM
prodOnlyWLang is the "No Fallback"
If so, do we still need to use "prodOnlyWLang" in config? Or "No Fallback" is a replacement of "prodOnlyWLang"?.

No Fallback is the description for the config value prodOnlyWLang. When you store the config, the file is read and any values which exists in the form overwrite the values. So when the value is not set in the form, but in the file, you get the value of the file, else it takes the value of the form. When you check the name of the input field, you will notice it has the name prodOnlyWLang.
So you dont need to use prodOnlyWLang in the config file and "No Fallback" is not a replacement.[/quote]


Regardless the answer is, it looks like "No Fallback" doesn't work. Whatever the setting is

"No Fallback"- YES /"prodOnlyWLang" - YES
"No Fallback"- YES /"prodOnlyWLang" - NO


There's no option to set a product in just one language. [/quote]
I do not understand how you mean this. When no fallback is active, you should use the same language for editing as you want to edit.

Quote from: Miku on May 19, 2017, 08:01:32 AM
Moreover, I can see two different behaviours of the system in case of ONLY "No Fallback" usage, depending on the language set in the J! Administrator, so when:
Dualfallback activated?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

Please open vmlaganguages.php in /administrator/com_virtuemart/helpers/ around line 286 and replace

if($c===null){
$c = VmConfig::$langCount>1 and VmConfig::$defaultLang!=VmConfig::$vmlang and !VmConfig::get('prodOnlyWLang',false) ;
}


with

if(VmConfig::$langCount>1 and VmConfig::$defaultLang!=VmConfig::$vmlang and !VmConfig::get('prodOnlyWLang',false) ){
$c = true;
} else {
$c = false;
}
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Miku

Quote from: Milbo on May 19, 2017, 09:43:07 AM
Please open vmlaganguages.php in /administrator/com_virtuemart/helpers/ around line 286 and replace

if($c===null){
$c = VmConfig::$langCount>1 and VmConfig::$defaultLang!=VmConfig::$vmlang and !VmConfig::get('prodOnlyWLang',false) ;
}


with

if(VmConfig::$langCount>1 and VmConfig::$defaultLang!=VmConfig::$vmlang and !VmConfig::get('prodOnlyWLang',false) ){
$c = true;
} else {
$c = false;
}


Works! Great :) Thank you.

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/