Hi! testing 4.2.6 I found an issue with custom fields. I have a select custom field and after changing the value, the url of the page gets the field value (not the real url) and the page doesn't change at all. I have found some changes in cvfind.js and customfield.php sub layout, here I publish my changes so the dev team can consider them.
cvfind.js
Change this
//We check first if it is a radio
jQuery(container).find('input[data-cvselection="true"]:checked').each(function() {
selection[selection.length] = jQuery(this).val();
found = true;
});
if(!found){
jQuery(container).find('input[data-cvselection="true"]').each(function() {
selection[selection.length] = jQuery(this).val();
});
}
To this...
//We check first if it is a radio
jQuery(container).find('[data-cvselection="true"]:checked').each(function() {
selection[selection.length] = jQuery(this).val();
found = true;
});
if(!found){
jQuery(container).find('[data-cvselection="true"]').each(function() {
selection[selection.length] = jQuery(this).val();
});
}
customfield.php
Change this
$attribs['data-cvsel'] = 'field' . $customfield->virtuemart_customfield_id ;
$fname = $fieldname.'['.$k.']';
To this
$attribs['data-cvsel'] = 'field' . $customfield->virtuemart_customfield_id ;
$attribs['data-cvselection'] = 'true';
$fname = $fieldname.'['.$k.']';
Also in this file, for some reason, if I get Itemid=0 in the url, it adds that 0 to the product ID, so, change this
$Itemid = vRequest::getInt('Itemid',''); // '&Itemid=127';
if(!empty($Itemid)){
$Itemid = '&Itemid='.$Itemid;
}
To this...
$Itemid = vRequest::getInt('Itemid',''); // '&Itemid=127';
if(!empty($Itemid)){
$Itemid = '&Itemid='.$Itemid;
} else if ($Itemid !== '') {
$Itemid = '';
}
Thank you for your work. I think you send me that via skype, right? That should be enhanced your way in the new version. Please check
Sorry Milbo, I don't even have Skype installed, but maybe another guy found this issue and sumbited similar fix.