The field orders_products_attributes.products_options_values should be TEXT - is it? If not is it possible the value is just getting truncated?
Printable View
The field orders_products_attributes.products_options_values should be TEXT - is it? If not is it possible the value is just getting truncated?
Is the .jpeg file's filename equally wrong in the "files_uploaded" table?
I suspect the issue may be occurring in this part of the code, in the shopping_cart.php class:
The green lines are related to the files_uploaded table, hence my question above. If that table's entry is fine, then perhaps the issue is happening afterward.Code:if ($products_options_file->parse(TEXT_PREFIX . $_POST[UPLOAD_PREFIX . $i])) {
$products_image_extension = substr($products_options_file->filename, strrpos($products_options_file->filename, '.'));
if (zen_is_logged_in()) {
$db->Execute("INSERT INTO " . TABLE_FILES_UPLOADED . " (sesskey, customers_id, files_uploaded_name) VALUES ('" . zen_session_id() . "', " . (int)$_SESSION['customer_id'] . ", '" . zen_db_input($products_options_file->filename) . "')");
} else {
$db->Execute("INSERT INTO " . TABLE_FILES_UPLOADED . " (sesskey, files_uploaded_name) VALUES ('" . zen_session_id() . "', '" . zen_db_input($products_options_file->filename) . "')");
}
$insert_id = $db->Insert_ID();
$real_ids[TEXT_PREFIX . $_POST[UPLOAD_PREFIX . $i]] = $insert_id . ". " . $products_options_file->filename;
$products_options_file->set_filename("$insert_id" . $products_image_extension);
if (!($products_options_file->save())) {
break;
}
} else {
The red line is (I think) where the filename is "set" for the orders_products_attributes entry. But it's still puzzling about the symptom you're reporting.
Do you have any attribute-related customizations/plugins installed?
I did a compare of shopping_cart.php to 1.5.7b. I did find one change
PHP Code:
// appears to confuse products priced by attributes
if ($product->fields['product_is_always_free_shipping'] == '1' or $product->fields['products_virtual'] == '1') {
$shipping_attributes_price = zen_get_discount_calc($product->fields['products_id'], $attribute_price->fields['products_attributes_id'],
$attribute_price->fields['options_values_price'], $qty);
//Set these variable to a numeric to eliminate warning debug logs - rb
$freeShippingTotal = intval($freeShippingTotal);
$shipping_attributes_price = intval($shipping_attributes_price);
$freeShippingTotal += $shipping_attributes_price;
}
It seems I may have figured this out. The old database had not been converted from utf8 to utf8mb4. The config file was set to the utf8mb4 charset. I modified the config file to utf8 and tested with the .jpeg extension. It loaded the file and added to the tables correctly. I'll continue to monitor this and will update again if it breaks.
You would be 100% correct in saying that the conversion plugin was not run. OOPS! :cool: