You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably a bug in Magento, but unfortunately it's quite common for 3rd party modules to incorrectly call getSource on attributes that don't have source models.
I first ran into an issue here, which was calling getSource() on everything it needed to send to GA (sku, name).
Next there was an SEO module that was calling getSource() on the name attribute. So it was being done by 2 different modules in the same project!
Not sure just yet what the best solution is, but might be nice to add some defense to detect for this situation. I'm willing to submit a PR.
The text was updated successfully, but these errors were encountered:
mpchadwick
added a commit
to mpchadwick/nicer-image-names
that referenced
this issue
Aug 4, 2016
Per Vinai#32 usesSource may incorrectly return true if getSource was previously called on the attribute.
If we didn't get the value the first time around (perhaps due to the getSource issue) we try to fetch again using the mechanics that would be used for attributes without source models.
I spent a bunch of time debugging why this extension wasn't working for me (none of the attributes were actually pulling values).
It turns out that
usesSource()
will incorrectly return true on an attribute ifgetSource()
was previously called on that attribute.getSource()
sets source model to default source model...https://github.com/OpenMage/magento-mirror/blob/magento-1.9/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php#L381
_getDefaultSourceModel()
returnseav/entity_attribute_source_table
https://github.com/OpenMage/magento-mirror/blob/d409dff20e992e97546568974399c456958299f9/app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php#L336-L339
usesSource
thinks that there's a source model...https://github.com/OpenMage/magento-mirror/blob/d409dff20e992e97546568974399c456958299f9/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php#L397
This is probably a bug in Magento, but unfortunately it's quite common for 3rd party modules to incorrectly call
getSource
on attributes that don't have source models.I first ran into an issue here, which was calling
getSource()
on everything it needed to send to GA (sku, name).Next there was an SEO module that was calling
getSource()
on the name attribute. So it was being done by 2 different modules in the same project!Not sure just yet what the best solution is, but might be nice to add some defense to detect for this situation. I'm willing to submit a PR.
The text was updated successfully, but these errors were encountered: