1

I'm creating new customer attribute in magento admin panel but it's returning an error Text length does not satisfy specified text range.

the attribute code is mag_customer_testing_id, the attribute code length is accepting less than 21.

how can i solve this?

Thanks.

  • Is enterprise edition or customer attributes extension? Or do you mean CUSTOM attribute? – Amasty Aug 14 '14 at 7:00
  • @Amasty, Enterprise Edition, yes custom attribute – Magento007 Aug 14 '14 at 7:02
1

So the reason for this is because:

customer attribute code can have prefix "customer_" and its length must be max length minus prefix length

Now the code for the limit can be found at app/code/core/Enterprise/Customer/Block/Adminhtml/Customer/Attribute/Edit/Tab/Main.php where it uses the constant Mage_Eav_Model_Entity_Attribute::ATTRIBUTE_CODE_MAX_LENGTH

So it appears that normally a EAV attribute has a limit of 30 characts, so product and customer. As to why this limit is in place I am sorry but I dont know. The table seems to allow 255, maybe someone else can tell you why.

There are some thoughts behind this limit here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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