I just got a Apostrophe FIX, that works pretty neat...
here what you need to do:
in admin/categories.php:
find:
if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) {
if (isset($extra_product_entry[$key])) { // an entry exists
if ($val == '') tep_db_query("DELETE FROM " . products_to_products_extra_fields . " where products_id = " . (int)$products_id . " AND products_extra_fields_id = " . $key);
else tep_db_query("UPDATE " . products_to_products_extra_fields . " SET products_extra_fields_value = '" . tep_db_prepare_input($val) . "' WHERE products_id = " . (int)$products_id . " AND products_extra_fields_id = " . $key);
}
else { // an entry does not exist
if ($val != '') tep_db_query("INSERT INTO " . products_to_products_extra_fields . " (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('" . (int)$products_id . "', '" . $key . "', '" . tep_db_prepare_input($val) . "')");
}
}
}
and replace with:
if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) {
if (isset($extra_product_entry[$key])) { // an entry exists
if ($val == '') tep_db_query("DELETE FROM " . products_to_products_extra_fields . " where products_id = " . (int)$products_id . " AND products_extra_fields_id = " . $key);
else tep_db_query("UPDATE " . products_to_products_extra_fields . " SET products_extra_fields_value = '" . tep_db_input($val) . "' WHERE products_id = " . (int)$products_id . " AND products_extra_fields_id = " . $key);
}
else { // an entry does not exist
if ($val != '') tep_db_query("INSERT INTO " . products_to_products_extra_fields . " (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('" . (int)$products_id . "', '" . $key . "', '" . tep_db_input($val) . "')");
}
}
}
(I replaced tep_db_prepare_input($val) to tep_db_input($val))
And then in catalog/product_info.php
find:
$extra_fields['value']
and replace with:
stripslashes($extra_fields['value'])
-the last one is needed to get rid of the slashes, that your data are stored with in the database.
(this also a fix for 1064 error, which I was getting when trying to add some data with slashes).
Should work fine... :)
ps. the uploaded file is the above text only. not a contribution.
More...





LinkBack URL
About LinkBacks









Bookmarks