-
-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
EAV Config Cache Bug: getAttribute() returns false at creating new attribute #3057
Comments
This happens because getAttribute no longer returns an empty model when the attribute does not exist. I think it's not a good idea to use this behavior to create an attribute in the first place. The way core installers add attributes is, for example: $installer->addAttribute('customer', 'confirmation', [
'label' => 'Is confirmed',
'visible' => false,
'required' => false,
]); |
@fballiano @kiatng You reviewed my original PR #2993 and probably looked into the issue as well. Perhaps it does make sense to restore the old "behavior" and return a empty model instance from |
Magento 1 and OpenMage provide more than one way to do things. So, for BC, I vote to restore the "old behaviour" to fix the "bug". |
I guess an empty model is fine, it's used in many places anyway so... |
Alright, I will create a PR for it. |
Preconditions (*)
Related to issue #2993. When investigating issue #3055, I was able to create a new attribute in ver 20.0.16 with this:
However, with ver 20.1.0-rc2 I get
The line is
$attribute->setWebsite($store->getWebsite());
.Steps to reproduce (*)
Mage::getSingleton('eav/config')->getAttribute('customer_address', 'select_invoice_type')
.Expected result (*)
Mage::getSingleton('eav/config')->getAttribute('customer_address', 'select_invoice_type')
returnsMage_Customer_Model_Attribute
Actual result (*)
Mage::getSingleton('eav/config')->getAttribute('customer_address', 'select_invoice_type')
returnsfalse
The text was updated successfully, but these errors were encountered: