Author Topic: The issue of prodOnlyWLang hidden config in VM 3.2.2  (Read 565 times)

Miku

  • Jr. Member
  • **
  • Posts: 79
  • A beginner
  • VirtueMart Version: 3.0.18, J!3.6.4
The issue of prodOnlyWLang hidden config in VM 3.2.2
« on: May 18, 2017, 12:41:54 pm »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9373
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: The issue of prodOnlyWLang hidden config in VM 3.2.2
« Reply #1 on: May 18, 2017, 15:02:28 pm »
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.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Miku

  • Jr. Member
  • **
  • Posts: 79
  • A beginner
  • VirtueMart Version: 3.0.18, J!3.6.4
Re: The issue of prodOnlyWLang hidden config in VM 3.2.2
« Reply #2 on: May 19, 2017, 08:01:32 am »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9373
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: The issue of prodOnlyWLang hidden config in VM 3.2.2
« Reply #3 on: May 19, 2017, 09:08:24 am »
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.

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?
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9373
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: The issue of prodOnlyWLang hidden config in VM 3.2.2
« Reply #4 on: May 19, 2017, 09:43:07 am »
Please open vmlaganguages.php in /administrator/com_virtuemart/helpers/ around line 286 and replace
Code: [Select]
if($c===null){
$c = VmConfig::$langCount>1 and VmConfig::$defaultLang!=VmConfig::$vmlang and !VmConfig::get('prodOnlyWLang',false) ;
}

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

Miku

  • Jr. Member
  • **
  • Posts: 79
  • A beginner
  • VirtueMart Version: 3.0.18, J!3.6.4
Re: The issue of prodOnlyWLang hidden config in VM 3.2.2
« Reply #5 on: May 19, 2017, 10:23:03 am »
Please open vmlaganguages.php in /administrator/com_virtuemart/helpers/ around line 286 and replace
Code: [Select]
if($c===null){
$c = VmConfig::$langCount>1 and VmConfig::$defaultLang!=VmConfig::$vmlang and !VmConfig::get('prodOnlyWLang',false) ;
}

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

Works! Great :) Thank you.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9373
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: The issue of prodOnlyWLang hidden config in VM 3.2.2
« Reply #6 on: May 19, 2017, 12:01:59 pm »
nice that we found the solution so fast
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/