Skip to content

Commit 9b02cf2

Browse files
kiatngfballiano
authored andcommitted
Fixed setting of source_model when adding new attribute and for multiselect (#1293)
1 parent ae95ef3 commit 9b02cf2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,10 @@ protected function _beforeSave(Mage_Core_Model_Abstract $object)
161161
}
162162

163163
/**
164-
* @todo need use default source model of entity type !!!
164+
* Set default source model.
165165
*/
166-
if (!$object->getId()) {
167-
if ($object->getFrontendInput() == 'select') {
168-
$object->setSourceModel('eav/entity_attribute_source_table');
169-
}
166+
if ($object->usesSource() && !$object->getData('source_model')) {
167+
$object->setSourceModel($object->_getDefaultSourceModel());
170168
}
171169

172170
return parent::_beforeSave($object);

0 commit comments

Comments
 (0)