Author Topic: disappearance of the customs fields BUG[solved]  (Read 847 times)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3905
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
disappearance of the customs fields BUG[solved]
« on: November 17, 2017, 18:54:32 pm »
Hi,
I had suddenly some missing custom fields, after adding some other same type of customfields in different positions.
the problem is in the file /components/com_virtuemart/sublayouts/customfield.php
Code: [Select]
if(!isset($customfield->display))$customfield->display = '';The $customfield->display is not empty, but after in the trigger
$ret = $dispatcher->trigger ('plgVmOnDisplayProductFEVM3', array(&$product, &$customfields[$k]));
 the reference &$customfields[$k] do not get always the right one and $customfield->display is not set.

On changing line 42
Code: [Select]
foreach($customfields as $k => $customfield){and using reference for the $customfield value
Code: [Select]
foreach($customfields as $k => &$customfield){
and modify line 57 in trigger &$customfields[$k]
Code: [Select]
$ret = $dispatcher->trigger ('plgVmOnDisplayProductFEVM3', array(&$product, &$customfields[$k]));to &$customfield
Code: [Select]
$ret = $dispatcher->trigger ('plgVmOnDisplayProductFEVM3', array(&$product, &$customfield));The behavior is correct and all my customfields are rendered in the product.

Note that i think that it's perhaps only in PHP7+

VirtueMart 3.2.4, Joomla! 3.8.1, PHP 7.0.25

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3905
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: disappearance of the customs fields BUG
« Reply #1 on: November 17, 2017, 23:21:53 pm »
Hum, the problem is not here.
It seems that when you have customfields for cart and standard customfields and display the minicart, the standard customfields get removed from product detail display.
You can try an example here :
http://pro.st42.fr/fr/test-product-no4-bug,-missing-fields.html

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3905
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: disappearance of the customs fields BUG
« Reply #2 on: November 17, 2017, 23:53:41 pm »
I removed minicart module in this product page:
http://pro.st42.fr/fr/bug-test-standard-customfields
And the standard fields are rendered correctly.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3905
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: disappearance of the customs fields BUG
« Reply #3 on: November 18, 2017, 01:19:54 am »
I found the origin of the problem.
When i try to display cart module inside product, it break, but not in other case.
I removed the cart module as customfield in product from my test and now it work.
But i dont know why it break ?
Some idear ?

aftertaf

  • Jr. Member
  • **
  • Posts: 205
    • sO couture
  • VirtueMart Version: 3.2.14
Re: disappearance of the customs fields BUG[solved]
« Reply #4 on: November 19, 2017, 22:33:48 pm »
no idea, but i have weird behaviour too with custom fields.
possibly no relation at ALL, but just saying.
If i could develop i'd look but i can't ;)
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.6//VM 3.2.14//PHP7.0.18 & mariadb 10.1.22 on Debian
big up to notepad++!!!!