Description
When importing products from a CSV file, I get the error Attribute %s exceeded max length in rows: 1
. Tracking it down, it seems that the error message is meant to be printf
'd at some point with the attribute name, but it never was - that string is used verbatim.
Some examples are included to replicate the error. Save them as a .csv file and run the "Check Data" in the Products Import page. (used Entity Type: Products; Import Behavior: Add/Update; then default values for the rest).
Please note that both of these examples will throw additional errors, as well as demonstrating the described behavior - I tried to cut my CSV file down to something small so I could include it here. The described behavior remains even when no other errors are thrown.
"Good" Data (does not throw an error)
sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,height,weight,length,width,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,additional_attributes,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id,related_skus,crosssell_skus,upsell_skus,additional_images,additional_image_labels,hide_from_product_page,custom_options,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,configurable_variations,configurable_variation_labels,associated_skus
ABC123,,Lorem Ipsum,simple,,base,Lorem Ipsum,"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet nisi magnam sit numquam quidem similique earum assumenda nesciunt a! Quos perspiciatis velit ipsum natus similique blanditiis possimus dignissimos inventore labore.",,0.01,0.0012,2,1.5,1,Taxable Goods,"Catalog, Search",0.69,,,,,Lorem Ipsum,,"This text has 255 characters. This text has 255 characters. This text has 255 characters. This text has 255 characters. This text has 255 characters. This text has 255 characters. This text has 255 characters. This text has 255 characters. This text has 2",,,,,,,,,,,Block after Info Column,,,,,,,,,,,Use config,,,,0,1,0,0,0,1,1,10000,1,1,1,0,0,0,1,1,1,1,0,1,,,,,,,,,,,,,,,
"Bad" Data
sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,height,weight,length,width,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,additional_attributes,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id,related_skus,crosssell_skus,upsell_skus,additional_images,additional_image_labels,hide_from_product_page,custom_options,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,configurable_variations,configurable_variation_labels,associated_skus
ABC123,,Lorem Ipsum,simple,,base,Lorem Ipsum,"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet nisi magnam sit numquam quidem similique earum assumenda nesciunt a! Quos perspiciatis velit ipsum natus similique blanditiis possimus dignissimos inventore labore.",,0.01,0.0012,2,1.5,1,Taxable Goods,"Catalog, Search",0.69,,,,,Lorem Ipsum,,"This text has 256 characters. This text has 256 characters. This text has 256 characters. This text has 256 characters. This text has 256 characters. This text has 256 characters. This text has 256 characters. This text has 256 characters. This text has 25",,,,,,,,,,,Block after Info Column,,,,,,,,,,,Use config,,,,0,1,0,0,0,1,1,10000,1,1,1,0,0,0,1,1,1,1,0,1,,,,,,,,,,,,,,,
The "bad" data has a meta_description with exactly 256 characters, and (for me), DB_MAX_VARCHAR_LENGTH
has a value of 256
in AbstractEntity.php
. Hence, it throws the error:
Attribute %s exceeded max length in rows: 1
when it should throw the error
Attribute meta_description exceeded max length in rows: 1