Author Topic: 3.2.4 bug in Products module  (Read 612 times)

fr56

  • Beginner
  • *
  • Posts: 7
3.2.4 bug in Products module
« on: November 11, 2017, 20:40:39 pm »
Products module, Layout field. The drop-down box gives three options, but when trying to save with the first option "No override", we get the message "Warning. Field required: Layout", and nothing is saved. The field is also marked with an asterisk (required). This seems like a moot point since the field cannot be left blank in any way.

This used to be ok before (not sure which version, we seldom need to edit this module).

Tested with VM 3.2.2 and 3.2.4, and various versions of Joomla, including 3.8.2.

aftertaf

  • Jr. Member
  • **
  • Posts: 156
    • sO couture
  • VirtueMart Version: 3.2.4
Re: 3.2.4 bug in Products module
« Reply #1 on: November 13, 2017, 23:21:20 pm »
i get warning but it saves
Webmaster for my wife (link in my profile ;)
Extensions / plugins : POSForWebshops, TemplatecreatorCK ,MaximenuCK, and PageBuilderCK, VM BatchEdit Pro, VM CustomFilters Pro, Awocoupon Pro, slogin, supersaas,  among other things...
Joomla! 3.8.2//VM 3.2.4//PHP7.0.18 & mariadb 10.1.22 on Debian
big up to notepad++!!!!

fr56

  • Beginner
  • *
  • Posts: 7
Re: 3.2.4 bug in Products module
« Reply #2 on: November 14, 2017, 18:20:36 pm »
Thanks for testing.

True, it looks like it's saving. But if you exit the module and re-enter you will see that whatever your changes are, they have not been saved, as long as "No override" is set. You may also check the frontend as well and you will see nothing changes.

aftertaf

  • Jr. Member
  • **
  • Posts: 156
    • sO couture
  • VirtueMart Version: 3.2.4
Re: 3.2.4 bug in Products module
« Reply #3 on: November 14, 2017, 20:17:12 pm »
ah, i dont use the product module anywhere (yet) so cant test on frontend.
seemed like it saved for me though. sorry if i muddied the waters...
Webmaster for my wife (link in my profile ;)
Extensions / plugins : POSForWebshops, TemplatecreatorCK ,MaximenuCK, and PageBuilderCK, VM BatchEdit Pro, VM CustomFilters Pro, Awocoupon Pro, slogin, supersaas,  among other things...
Joomla! 3.8.2//VM 3.2.4//PHP7.0.18 & mariadb 10.1.22 on Debian
big up to notepad++!!!!

fr56

  • Beginner
  • *
  • Posts: 7
Re: 3.2.4 bug in Products module
« Reply #4 on: November 14, 2017, 21:50:34 pm »
Not at all, you helped clarify the case by pointing out that it may look like the configuration is saved.

If you can try once more in the backend and then possibly confirm the bug.

Create a module and save with Layout=Default. Everything is saved ok. Then set Layout=No override, and maybe change a few other fields as well, and save. You will get the warning. Exit the module and re-enter and what do you see? Has anything been saved?

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2402
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: 3.2.4 bug in Products module
« Reply #5 on: November 15, 2017, 11:12:39 am »
I can reproduce the bug.
This is because the XML require à value, but using "No override" set it to nothing.
A solution is in /modules/mod_virtuemart_product/mod_virtuemart_product.xml to remove required="true" from line
Code: [Select]
        <field
          name="layout"
          type="vmlayout"
          label="MOD_VIRTUEMART_PRODUCT_LAYOUT"
          required="true"
          extension="com_virtuemart"
          view="mod_virtuemart_product"
          description="MOD_VIRTUEMART_PRODUCT_LAYOUT_DESC"
        />
In all case, this is not required, Joomla fallback to default if the layout file is not found.

fr56

  • Beginner
  • *
  • Posts: 7
Re: 3.2.4 bug in Products module
« Reply #6 on: November 15, 2017, 12:52:22 pm »
Thanks, that removes the "required part".
But "No override" isn't what's displayed in the front end even if it's set in the backend, so this needs more fixing.

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2402
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: 3.2.4 bug in Products module
« Reply #7 on: November 15, 2017, 21:53:03 pm »
This fix the bug. as i said, in all case "no overidde" is == to default, because it fallback to default.php layout.
So to say "no overidde" is a stupid for a module layout setting that should not display in the list at all because the logic of joomla is :
 "no overidde"  = empty value, this get never found because .php is not valid and display default.php. so no override need an extra step to get same result as using default

fr56

  • Beginner
  • *
  • Posts: 7
Re: 3.2.4 bug in Products module
« Reply #8 on: November 20, 2017, 11:41:18 am »
Sorry for the late reply, I've been busy.

No this does not fix the bug, and "no override" is not the same as default. We have several copies of this module that uses no override, and they work fine as long as we don't edit any of them with the present version.

If I change

params "layout":""

to

params "layout":"0"

in the modules table then it's working ok.
So the missing "0" is the culprit.

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2402
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: 3.2.4 bug in Products module
« Reply #9 on: November 20, 2017, 13:42:22 pm »
If you set module to "default", does this change something in your case?
default is always fallback in Joomla. So i really dont understand why you need "no override" ???
If you check in all other modules using Joomla core layout setting, "no overide" does not exist.

fr56

  • Beginner
  • *
  • Posts: 7
Re: 3.2.4 bug in Products module
« Reply #10 on: November 20, 2017, 15:09:05 pm »
We're using Olympian Themes Horme 3 Pro template, and yes, it does change. I've tried to upload a small jpg-file to show, but that doesn't seem to be working.

Besides, if "no override" is the same as default (which it isn't), why would the option be there in the first place?

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2402
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: 3.2.4 bug in Products module
« Reply #11 on: November 20, 2017, 21:41:13 pm »
It's same in all Joomla modules because in all module layout is set using this way :
$layout = $params->get('layout','default');
require(JModuleHelper::getLayoutPath('mod_virtuemart_product',$layout));
And if empty, no layout are found and us set to default
This is the case for 99% of the modules and for all Virtuemart core modules.
SO using empty value, mean loading default layout, because this is the case in Joomla since 10 years or more.

fr56

  • Beginner
  • *
  • Posts: 7
Re: 3.2.4 bug in Products module
« Reply #12 on: November 20, 2017, 23:28:38 pm »
Studio 42, you're obviously trying to convince me that the bug is not a bug, so no point in discussing this any further. It's like talking to a wall.

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2402
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: 3.2.4 bug in Products module
« Reply #13 on: November 21, 2017, 03:07:16 am »
I think you dont understand.
I dont said it's not a bug, but that the "no override" is only in Virtuemart, because the VM core team do not use Joomla layout, but have done own way to check layouts using VirtueMartModelConfig::getLayoutList
If you have for eg. a layout in the non default template, Virtuemart do not find it, because the  code is :
Code: [Select]
$q = 'SELECT `template` FROM `#__template_styles` WHERE `client_id` ="0" AND `home`="1" ';

$db = JFactory::getDBO();
$db->setQuery($q);

$tplnames = $db->loadResult();
And only load 1 template, the default.
And add a "no overidde' option.

Check any other modules that is not from VM team.
You get always all templates and never "no overides", because "no overides" is a logical error for  joomla modules.

So yes, its bugged and yes it's limited, but this bug and option should not exist.
You understand better ?