Question

When I try to create a new account, the system returns this error:

"Firstname" is a required value. "Firstname" length must be equal or greater than 1 characters.

The POST however does contain all required fields:

Request URL: http://domain.com/customer/account/createpost/
form_key: vSYF9fBkMNJ5BoXc
success_url: 
error_url: 
firstname: John
lastname: Doe
email: email@gmail.com
password: ABC_123456
password_confirmation: ABC_123456

I checked the data in the isValid() function in /vendor/magento/module-eav/Model/Validator/Attribute/Data.php and I noticed the firstname value is empty, unlike other values like lastname. So it seems that the firstname value got lost somewhere during the processing between the POST and the isValid method.

I found out that firstname is missing in the customer-attributes in /vendor/magento/module-customer/Model/Metadata/Form.php (it contains created_at , prefix, middlename, lastname, suffix, email, dob, taxvat, gender), so I guess there must be a problem in the customer configuration.

What could be the cause of this issue?

Was it helpful?

Solution

Spend lots of hours on this. The firstname attribute appeared to be missing "customer_account_create" form code in the customer_form_attribute table. I have no idea why. Fixed it by manually adding it to the table:

INSERT INTO `customer_form_attribute` (`form_code`, `attribute_id`) VALUES ('customer_account_create', '5');
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top