While generating a bulk product, with 5 attributes, and 4 options each, I got the following message :
"Product cannot be longer than 128 characters but is currently 11086 characters long"

With Commerce technique to deal with attributes/options it has to generate a huge amount of product with different SKU.

I am really bad at code, so could anyone lead me to the proper path to solve that,

thank you!

Comments

dufferin’s picture

could bypass the problem changing autofill field for a select list, it works and makes the selection way easier when you have a lot of sku.

So still not rocket proof, but a way.

sven.lauer’s picture

Title: Increase Product Lengh when create Product Display » Autocomplete field has low character limit, no way to adjust limit.
Project: Commerce Bulk Product Creation » Commerce Core
Version: 7.x-1.0-rc5 » 7.x-1.x-dev
Component: Code » Product reference
Category: support » bug

This is really an issue about the autocomplete widget of the product reference module in commerce core. Moving to the correct queue.

Labeling as a bug, as the widget does not have a setting for controlling the character limit, and also 128 seems prohibitively low in any case.

amateescu’s picture

Title: Autocomplete field has low character limit, no way to adjust limit. » Autocomplete field has low character limit and no way to adjust it
Status: Active » Closed (works as designed)

Actually, commerce_product_reference.module has a maxlength of 2048 (it's in commerce_product_reference_field_widget_form()). But anything longer than that is completely unusable, so yes, using the select list widget is the best way to go here.

sven.lauer’s picture

Title: Autocomplete field has low character limit and no way to adjust it » Autocomplete field gives misleading error message if the character limit is exceeded
Status: Closed (works as designed) » Active

If that is the case, the message should be fixed to indicate the correct character limit (now it is saying the limit is 128).

I opened #1412954: Indicate that autocomplete widget is dispreferred for product reference fields working with bulk creation as a follow up in the bulk creation queue to document that it is generally unwise to use autocomplete fields on content types used with bulk creation.

amateescu’s picture

Project: Commerce Core » Commerce Bulk Product Creation
Component: Product reference » Code

When I try to exceed the character limit in the autocomplete field provided by commerce core, I get this message: Product cannot be longer than 2048 characters but is currently 2344 characters long.

This can only mean that Bulk Product Creation is overriding the default settings somewhere.

sven.lauer’s picture

Project: Commerce Bulk Product Creation » Commerce Core
Component: Code » Product reference
Status: Active » Closed (duplicate)

Actually, with a current commerce version, the message is correct with BPC, as well (as it should be). I assume that @dufferin used a version that did not have the fix for this.

So moving back to commerce queue and closing as a duplicate of #1115994: Increase product reference autocomplete textfield maxlength from 128 to unlimited.

dufferin’s picture

Version: 7.x-1.x-dev » 7.x-1.0-rc3
Component: Product reference » Documentation
Category: bug » support
Status: Closed (duplicate) » Active

@sven.lauer
I use rc5.

But definitely, the select list for product display, is the best way to handle the huge amount of skus. It's ordered by the product root title,

amateescu’s picture

Component: Documentation » Product reference
Category: support » bug
Status: Active » Closed (duplicate)