Published: September 22, 2018
Last updated:

Fatal error: Uncaught Error: Call to a member function getBackend() on bool in app/code/core/Mage/Eav/Model/Entity/Abstract.php:1538

Blank screen or the following fatal error is thrown on attempt to change customer’s password in Frontend or Backend or request a password reset after applying SUPEE-10752 or SUPEE-10888 or upgrade:

Fatal error: Call to a member function getBackend() on a non-object in app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1536.
or (in newer versions)
Fatal error: Uncaught Error: Call to a member function getBackend() on bool in app/code/core/Mage/Eav/Model/Entity/Abstract.php:1538
The error started after SUPEE-10752 or SUPEE-10888 installation or after upgrade to Magento 1.9.3.9 or newer versions including OpenMage LTS.

Cause

SUPEE-10570v2 adds new attribute in database (`password_created_at`) and without such attribute the customer model can not be loaded on accessing password change code after the next patch, SUPEE-10752. SUPEE-10888 as well adds `rp_customer_id` attribute, so after SUPEE-10888 both attributes are required.
To make sure that these attributes exist, you can look into `eav_attribute` table for attributes with such attribute_code:
MariaDB [magento]> select attribute_id,attribute_code,backend_type,frontend_input,frontend_label,is_required from eav_attribute where attribute_code in ('rp_customer_id','password_created_at');
+--------------+---------------------+--------------+----------------+---------------------+-------------+
| attribute_id | attribute_code      | backend_type | frontend_input | frontend_label      | is_required |
+--------------+---------------------+--------------+----------------+---------------------+-------------+
|          210 | password_created_at | int          | text           | Password created at |           0 |
|          211 | rp_customer_id      | varchar      | hidden         | NULL                |           0 |
+--------------+---------------------+--------------+----------------+---------------------+-------------+
2 rows in set (0.00 sec)

Solution

Make sure that you have correctly installed SUPEE-10570v2, SUPEE-10752 and SUPEE-10888 and all database upgrade scripts are in place.
Flush Magento cache to execute database upgrade scripts (i.e. app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0.4.1.2-1.6.2.0.4.1.3.php and app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0.1.1.1-1.6.2.0.1.1.2.php for Magento 1.9.2.4). These scripts should be executed automatically after cache flush.
Alternatively, as suggested by @Glindemann in comments below you can use the following SQL command to insert the attribute manually:
INSERT INTO `eav_attribute` (entity_type_id,attribute_code,attribute_model,backend_model,backend_type,backend_table,frontend_model,frontend_input,frontend_label,frontend_class,source_model,is_required,is_user_defined,default_value,is_unique,note) VALUES  (1,'rp_customer_id',NULL,NULL,'varchar',NULL,NULL,'hidden',NULL,NULL,NULL,0,0,NULL,0,NULL);
or
INSERT INTO `eav_attribute` (entity_type_id,attribute_code,attribute_model,backend_model,backend_type,backend_table,frontend_model,frontend_input,frontend_label,frontend_class,source_model,is_required,is_user_defined,default_value,is_unique,note) VALUES  (1,'password_created_at',NULL,NULL,'int',NULL,NULL,'text','Password created at',NULL,NULL,0,0,NULL,0,NULL);

Please do not forget to add links to these newly created attributes into `customer_eav_attribute` table as well:
MariaDB [mage]> SELECT is_visible,input_filter,multiline_count,validate_rules,is_system,sort_order,data_model,is_used_for_customer_segment FROM customer_eav_attribute WHERE attribute_id IN (select attribute_id FROM eav_attribute where attribute_code IN ('password_created_at','rp_customer_id'));
+------------+--------------+-----------------+----------------+-----------+------------+------------+------------------------------+
| is_visible | input_filter | multiline_count | validate_rules | is_system | sort_order | data_model | is_used_for_customer_segment |
+------------+--------------+-----------------+----------------+-----------+------------+------------+------------------------------+
|          0 | NULL         |               0 | NULL           |         1 |          0 | NULL       |                            0 |
|          0 | NULL         |               0 | NULL           |         1 |          0 | NULL       |                            0 |
+------------+--------------+-----------------+----------------+-----------+------------+------------+------------------------------+

 

Posted in: Fatal errors

43 votes, 5.00 avg. rating (99% score)