Skip to content
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

Attribute_optionField error #85

Open
intotheweb101 opened this issue Feb 25, 2015 · 4 comments
Open

Attribute_optionField error #85

intotheweb101 opened this issue Feb 25, 2015 · 4 comments

Comments

@intotheweb101
Copy link

Hello

I have just found a error that on IE8 it returns an error on line 47 char 10 on file Attribue_OptionField.js.

What is happening is it returns a blank dropdown field for the second option field. The top one works fine. It is just the data on drop down 2 that isn't working.

dropdown_2_not_showing

Any help would be greatly appreciated

Thanks

Hadlee

@intotheweb101
Copy link
Author

Hello

I have found a fix.

If you remove this code here from line 47-49 on Attribute_OptionField.js:

if (variationOptions.filter(function(elem) {
    return partial.indexOf(elem) > -1;
}).length == partial.length) {

Into this

if (variationOptions.length == partial.length) {

This may not be the correct fix but it haas been a temporary fix for me

Thanks Hadlee

@frankmullenger
Copy link
Contributor

Thanks @hadlee, I suspect IE8 is missing some functions like filter() and indexOf(). I can't remember but I think there was probably a valid reason why the code was not simply comparing .length - perhaps to take care of an edge case issue. It might be easier if you use a shim (e.g: https://github.com/es-shims/es5-shim) rather than patching this?

@silverstripe-elliot
Copy link

.filter() is implemented in jQuery, and I think there's a differently named equivalent for .indexOf(). You could also load the Underscore JS library to accomplish both

@elkebe
Copy link

elkebe commented Aug 24, 2017

this is also happening on Safari, using Silverstripe 3.6.1... would be great if this was fixed.
Using above workaround @intotheweb101 works, but doesn't reflect any variations to price - this may or may not be related?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants