Vinai / nicer-image-names

Magento extension to build catalog image file names from product attributes so they have neat descriptive names.
77 stars 31 forks source link

Add safety in case getSource was called #33

Closed mpchadwick closed 8 years ago

mpchadwick commented 8 years ago

Per #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.

Vinai commented 8 years ago

Thanks for the PR! The additional check if $value is true would fail for empty strings or strings starting with a "0". How about changing the check for usesSource() to check if the frontend input is select or multiselect?

mpchadwick commented 8 years ago

@Vinai updated per your feedback.

mpchadwick commented 8 years ago

@Vinai don't mean to be a pest, but I'm trying to install this on one of our sites, but it won't work until this issue is resolved.

Vinai commented 8 years ago

Thanks for your effort!