Magento 2.2 Customer Edit Form – Telephone is a Required Value

magento2magento2.2

I have overrided customer edit form. But while saving record I'm getting error message

"Telephone" is a required value.

I don't want telephone field. So in my form telephone field is not there but still error is coming.

Best Answer

There is a Magento2 feature that is by default telephone field is required. There is a lot of discussion on below topic:

https://github.com/magento/magento2/issues/1691

There is also a suggestion on this topic that we can make it optional by running SQL script

update eav_attribute set is_required=0 where attribute_code='telephone';

Read full topic and then run the query.

Note: Take a backup of DB before making any change.

After run query check eav_attribute table and make sure attribute column value changed to is_required to 0.enter image description here

Run reindex command for attributes only

php bin/magento indexer:reindex catalog_product_attribute

and delete all cache and static files, compile and regenerate code by below command

php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Hope this will help you.

Related Topic