Published: March 31, 2019
Last updated:

Middle Name on Magento Checkout page displayed after upgrade despite configuration

After Magento upgrade up to 1.9.2.1 or newer version you may notice Middle Name field is shown on Checkout, Customer Registration and other Frontend forms despite its configuration setting in Backend, at System > Configuration > Customers > Customer Configuration > Name and Address Options > Show Middle Name (Initial) option. Yet the option is set to “No“, Middle Name initial is still shown in every form on Frontend.

Cause

In newer Magento version (1.9.2.1 and above) the option is moved from core_config_data table into customer_eav_attribute.

Prior to 1.9.2.1:
mysql > select * from core_config_data where path='customer/address/middlename_show' and scope='default';
+-----------+---------+----------+----------------------------------+-------+
| config_id | scope   | scope_id | path                             | value |
+-----------+---------+----------+----------------------------------+-------+
|       757 | default |        0 | customer/address/middlename_show | 0     |
+-----------+---------+----------+----------------------------------+-------+

After 1.9.2.1:
mysql > select attribute_id,is_visible from customer_eav_attribute where attribute_id in (select attribute_id from eav_attribute where attribute_code='middlename');
+--------------+------------+
| attribute_id | is_visible |
+--------------+------------+
|            6 |          1 |
|           21 |          1 |
+--------------+------------+

Solution

You can simply toggle the option several times in Backend at System > Configuration > Customers > Customer Configuration > Name and Address Options > Show Middle Name (Initial) to save it in correct table.
Alternatively, you can execute the following SQL command from checklist we use during our M1 upgrade service:
sql > UPDATE `customer_eav_attribute` 
        SET `is_visible` = IFNULL (
              ( SELECT `value` FROM `core_config_data` 
                  WHERE path='customer/address/middlename_show' AND scope='default' LIMIT 1),
               0)  
             WHERE  `attribute_id` IN 
               (SELECT `attribute_id` FROM `eav_attribute` 
                    WHERE `attribute_code`='middlename');


If you have any difficulties with solving this problem or got a similar one, please let us know in comments below, so we can find the solution together.

Posted in: Known issues, Magento Maintenance

45 votes, 4.80 avg. rating (95% score)