0

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?

  • I think have thirt-party module handle your request. Please check on app/code/... or vendor folder. Search by "customer_register_success" even or "Magento\Customer\Controller\Account\CreatePost". Good luck! – xanka Jun 4 at 8:57
  • I could not find anything in the app/code folder. Problem seems to be somewhere in the customer attribute configuration (firstname is missing). I updated my question. – klaaskox Jun 4 at 14:28
0

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');

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.