When I save configurable product with big length sku then error showing

"0":"Notice: Undefined variable: product in /MASKED_DIR/2018-08-06_12-56-07/htdocs/vendor/magento/module-catalog/Controller/Adminhtml/Product/Save.php on line 156"

1 Answer 1


I Fixed in my website!
Please check below process

  1. set "const SKU_MAX_LENGTH = 255;" in the file module-catalog/Model/Product/Attribute/Backend/Sku.php

  2. You need to change the into database as well. Go to table eav_attribute, search for sku at column attribute code then edit the resulted row.

    Update the field frontend_class to null or validate-length maximum-length-255 according to your requirement.

  3. You have to change field size at the database table.

    ALTER TABLE catalog_product_entity CHANGE sku sku VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'SKU';

  • that didn't work for me :/
    – Greg
    Jan 29, 2019 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.