See title. You cannot set the order of the custom fields anymore. It doesnt get saved.
Has it ever had such a possibility? ???
Quote from: hazael on February 21, 2025, 15:08:58 PMHas it ever had such a possibility? ???
Most definitely.
I found an error. in the file customfields.php in administrator\components\com_virtuemart\models\ on line 1758
change
if(!empty($customfield->ordering)){
to
if(isset($customfield->ordering)){
caused by the fact that php empty() also takes zero as empty and each new inserted field has ordering 0 :/
Thanks mate
Acctually I don't need it, but as I remember well, someone already wrote about this problem once and it was solved exactly the same way. It's just strange that the Virtuemart authors don't read this forum to use user comments to fix these bugs :)
This whole post is a perfect example, why none of the veterans reacted. The ordering was tested by the team, just before. But we did the test error to test it on already existing products and that worked, because the ordering was not 0. The ordering was assumingly working until the release after the committ 11100. The solution above fixes the problem, if done for the second, now commmented if, not for the first.
if(empty($customfield->ordering)){
$customfield->ordering = 0;
}
//if(!empty($customfield->ordering)){
$html .= '<input class="ordering" type="hidden" value="'.$customfield->ordering.'" name="field[' . $i . '][ordering]" />';
//}
The hidden input was not set if the ordering was 0. And the whole thing is line 1783, so the fix was too short. So I or some other mod sees this post and thinks either "cant be true, I just tested it" or test it and it works again, because the error does not appear products stored before. The real fix is just to remove the added if completly.
Thanks I see it's fixed in the latest core build. Thanks for that.