New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add safety in case getSource was called #33

Merged
merged 1 commit into from Aug 8, 2016

Conversation

Projects
None yet
2 participants
@mpchadwick
Contributor

mpchadwick commented Aug 4, 2016

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

This comment has been minimized.

Owner

Vinai commented Aug 5, 2016

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?

Add safety in case getSource was called
Per #32 usesSource may incorrectly return true if getSource was previously called on the attribute.

@mpchadwick mpchadwick force-pushed the mpchadwick:getSource-safety branch from 68057a4 to ad026e0 Aug 5, 2016

@mpchadwick

This comment has been minimized.

Contributor

mpchadwick commented Aug 5, 2016

@Vinai updated per your feedback.

@mpchadwick

This comment has been minimized.

Contributor

mpchadwick commented Aug 8, 2016

@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

This comment has been minimized.

Owner

Vinai commented Aug 8, 2016

Thanks for your effort!

@Vinai Vinai merged commit bc034f3 into Vinai:master Aug 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment