News:

Support the VirtueMart project and become a member

Main Menu

disappearance of the customs fields BUG[solved]

Started by Studio 42, November 17, 2017, 18:54:32 PM

Previous topic - Next topic

Studio 42

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
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
foreach($customfields as $k => $customfield){
and using reference for the $customfield value
foreach($customfields as $k => &$customfield){

and modify line 57 in trigger &$customfields[$k]
$ret = $dispatcher->trigger ('plgVmOnDisplayProductFEVM3', array(&$product, &$customfields[$k]));
to &$customfield
$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

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

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

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

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 ;)