News:

Looking for documentation? Take a look on our wiki

Main Menu

Bug: Product Form

Started by doorknob, October 30, 2008, 01:07:18 AM

Previous topic - Next topic

doorknob

In conjunction with the product type parameter problem with special characters posted previously, The Product Form has a problem processing values. The following fixes the problem (and also improves xhtml compliance if anyone is interested in the backend)

product.product_form.php lines 1102 to 1112 were changed from
    foreach($fields as $field) {
    echo "<option value=\"$field\"".(($selected_value[$field]==1) ? " selected>" : ">"). $field."</option>\n";
    }
    }
    else {  // Other Parameter type
    echo "\">\n";
    foreach($fields as $field) {
    echo "<option value=\"$field\" ";
    if ($dbp->f($dbpt->f("parameter_name")) == $field) echo "selected=\"selected\"";
    echo " >".$field."</option>\n";
    }

to
    foreach($fields as $field) {
$html_field = shopMakeHtmlSafe( $field );
    echo '<option value="'.$html_field.'"'.(($selected_value[$field]==1) ? ' selected="selected">' : ">"). $html_field."</option>\n";
    }
    }
    else {  // Other Parameter type
    echo "\">\n";
    foreach($fields as $field) {
$html_field = shopMakeHtmlSafe( $field );
    echo '<option value="'.$html_field.'"'.(($dbp->f($dbpt->f("parameter_name")) == $field) ? ' selected="selected">' : ">").$html_field."</option>\n";
    }


Regards
phil