0

I have a big issue with Customer Registration and Login(which may or may not be connected). When I try to register as a customer on my website, it goes through successfully and redirects to accounts page. However, as soon as I click anywhere to edit any information or check any further detailed information about my account, it redirects to login page, and I can't login at all.

I tried to check at the admin panel, if the account was registered (customers>manage customers), and the account is shown on the table of all the customer accounts. However, if I click on any customer to view or change edit the customer details, I face Fatal error as follows :

Fatal error: Call to a member function setDisabled() on a non-object in /var/www/vhosts/tiendasagatha.co.uk/htdocs/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php on line 83

Also, if I try to add a new customer from the add new customer option (Admin Panel : Customers > Manage Customers), I face the fatal error as follows :

Fatal error: Call to a member function addClass() on a non-object in /var/www/vhosts/tiendasagatha.co.uk/htdocs/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php on line 87

I have another magento website, where it works just fine and I copy/pasted the Account.php file from there to the site that I'm facing this problem with, but it didn't help either.

Can anyone suggest a fix to this?

1
  • Thanks Really Great answer. i solve my using query with out any code.
    – Janmesh
    May 31, 2017 at 10:58

1 Answer 1

1

This has something to do with website_id attribute of customer.

  • Check whether website_id column is there in customer_entity table and check values are correctly entered for your customers.
  • It requires website_id should be there in all customer forms. Magento renders admin customer edit form using Mage_Eav_Model_Form with a form code adminhtml_customer. So if the customer attribute website_id is removed from this form, then it is possible to get this error.

EDIT

In order to make sure, there is nothing wrong with customer form related to website_id, you need to look into the table customer_form_attribute. There should be an entry corresponds to website_id with a form code adminhtml_customer.

To get the attribute_id corresponds to website_id attribute, you can use this query

SELECT attribute_id FROM eav_attribute WHERE entity_type_id IN (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'customer') AND attribute_code="website_id";

Now check this attribute_id is present in customer_form_attribute table for an attribute code adminhtml_customer.

If it is also looks good, then you can try your luck with below query:

UPDATE eav_attribute SET entity_type_id = 1 WHERE attribute_code = "website_id";

PS: Take backup of your db, if you want to run last query.

11
  • I just confirmed that customer_entity table does have website_id column in there. How do I check if the values are correctly entered for the customers?
    – S.Shahbaz
    Nov 2, 2016 at 15:05
  • check website_id column value for last entries. Nov 2, 2016 at 15:10
  • The most recent one is "NULL" however, the two prior to that are 1. (There are only 3 entries in the table)
    – S.Shahbaz
    Nov 2, 2016 at 15:13
  • so that means, customers are not saving correctly. It should be 1 as like very first entry. Nov 2, 2016 at 15:17
  • That's what I think as well. The registration page isn't working, and like I have already mentioned in the question, the Manual Admin Page Customer Registration results in fatal error mentioned in the question. What should I do to fix this?
    – S.Shahbaz
    Nov 2, 2016 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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