문제

Magento ver. 1.7.0.2

When creating an account (/customer/account/create) I get the error "The last name cannot be empty." even though I entered a last name.

In the controller...

/app/code/core/Mage/Customer/controllers/AccountController.php

..I added a var_dump() at line 277 (createPostAction)

// die(var_dump($_POST));
// result

array(7) { 
["success_url"]=> string(0) "" 
["error_url"]=> string(0) "" 
["firstname"]=> string(3) "Jon" 
["lastname"]=> string(8) "Chambers" 
["email"]=> string(21) "abcd@hotmail.com" 
["password"]=> string(8) "password" 
["confirmation"]=> string(8) "password" 
}

The "lastname" is being passed in the $_POST but it is not being added to $customerData.

// die(var_dump($customerData));
// Result

array(2) { 
["firstname"]=> string(3) "Jon" 
["email"]=> string(21) "clhosting@hotmail.com" 
}

Has anyone run into this before or know a workaround for it?

Thanks.

Edit:

It was a long road... thanks to Slayer Birden who got me started in the right direction. From there I saw that lastname did not register in any inputs (create account, customer info, etc).

I ended replacing all the [database]_customer_... tables. That got me back on track and it's all working again, phew!

도움이 되었습니까?

해결책

If you check method Mage_Eav_Model_Form::extractData you'll see that it iterates the entity attributes and tries to set data for them.

So you need to check if you have all your customer attributes in place.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top