3

I added two lines to eav_attribute_label that look like this:

attribute_id: 10,
store_id: 1
value: Address Number

attribute_id: 10,
store_id: 3
value: Address Number

This was an attempt to change the label of the lastname attribute in the customer_address entity type. This works fine in the front-end, and in form validation errors, etc.

However, now when I try to add a new address during checkout, I get this:

Item (Mage_Customer_Model_Attribute) with the same id "10" already exist

#0 \lib\Varien\Data\Collection\Db.php(576): Varien_Data_Collection->addItem(Object(Mage_Customer_Model_Attribute))
#1 \lib\Varien\Data\Collection.php(741): Varien_Data_Collection_Db->load()
#2 \app\code\core\Mage\Eav\Model\Form.php(263): Varien_Data_Collection->getIterator()
#3 \app\code\core\Mage\Eav\Model\Form.php(360): Mage_Eav_Model_Form->getAttributes()
#4 \app\code\core\Mage\Checkout\Model\Type\Onepage.php(541): Mage_Eav_Model_Form->extractData(Object(Mage_Core_Controller_Request_Http))
#5 \app\code\local\Forix\Custom\Model\Checkout\Type\Onepage.php(14): Mage_Checkout_Model_Type_Onepage->saveShipping(Array, '')
[...]

Any idea why this would act like I'm trying to create a new attribute, just because I changed the label of that attribute in the database? (The same database approach works for catalog_product attributes.)

0

1 Answer 1

2

Not sure if you got this fixed or not, but I had a duplicate set of labels for my attribute ID in the eav_attribute_label table, which was causing this exception:

mysql> select * from eav_attribute_label where attribute_id = 26;
+--------------------+--------------+----------+--------+
| attribute_label_id | attribute_id | store_id | value  |
+--------------------+--------------+----------+--------+
|                 49 |           26 |        1 | Suburb |
|                 50 |           26 |        2 | Suburb |
|                 51 |           26 |        3 | Town   |
|                 64 |           26 |        1 | Suburb | <----
|                 65 |           26 |        2 | Suburb | <---- Duplicates!
|                 70 |           26 |        3 | Town   | <----
+--------------------+--------------+----------+--------+
6 rows in set (0.00 sec)

Removing the duplicated set fixed my issue.

Your Answer

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

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