While I'm adjusting the css and other things for IE7+ I regognize that Ubercart Conditional Attributes module doesn't seem to work in IE7. The module's script renders error as well breaks all other scripts (cufon, jquery.. etc) on same page.

Comments

stewart.adam’s picture

I will get a chance to test this later today, but do any specific errors appear in the IE error console?

miccelito’s picture

(---) but do any specific errors appear in the IE error console?

Not really, only says that an object is missing.

As for your information I'm also using uc_aac module. However, the IE7 error appears as soon as Ubercart Conditional Attributes module is enabled.

Edit: It' seems that something needs to be added/modified in uc_conditional_attributes.js
Hope you probably will solve it. Good luck!

stewart.adam’s picture

I just tested this on a site that is also using the uc_aac patch and it worked correctly. Is there a URL where I can access the site in question to see the error you're experiencing?

miccelito’s picture

I could send you some url by Drupal webmail so you can see what happens in IE7
I haven't added the uc_aac patches (I guess there are two patches) yet. Could that be the reason? Could you test on a site without using the uc_aac patch?

Edit: I've sent you some sample URL's by webmail
Edit2: Even tho if i disable the uc_aac module the mentioned IE7 error remains, so it's not an uc_aac issue

stewart.adam’s picture

Thanks for the links, that helped debug the problem. IE7 doesn't seem to like trailing commas in object definitions, for example:

$.someFunction({
  'attr1': 'value',
  'attr2': 'value', // this line will cause errors in IE7
});

I've pushed out a fix so a new dev release should be out shortly. Please give that at try and let me know if it solves your problem.

You can also apply the change immediately, as it's a very simple one. In uc_conditional_attributes.js, in the function uc_conditional_attributes_filter_attr_options() you'll see a line $("select[name*=" + element_id + "]").html(html);. The line just after it has a trailing comma - simply remove it.

miccelito’s picture

Did as explained above and it seems to have solved the IE7 error issue related to uc_conditional_attributes. Thanks!

I still see an IE7 error on one of the category pages (taxonomy term page) but that error seems to be caused of some another reason.

Edit: If looking at Chrome's javascript control displaying this error:
Uncaught TypeError: Cannot use 'in' operator to search for '23' in undefined uc_conditional_attributes.js:103

Edit2: Let's say I have a product class (content type) named "Items X". If adding a Conditional Attribute Definition to "Items X" then it seems that I have to add those attributes to each product within the "Items X". Not doing so seems to render an IE7 error when displaying the products of "Items X" on i.e. a Views' taxonomy page (taxonomy/term/%).
Well, complicated to explain, but hope you understand...

halloffame’s picture

Latest dev does not work on all IE versions and does not return any error either. I don't use uc_aac.

stewart.adam’s picture

@miccelito, I tried to reproduce that problem but could not using the steps you described. Here's what I did:

  1. Created attributes A, B and C
  2. Created a product class X and taxonomy Y
  3. Created a few nodes of X and assigned them to terms in Y
  4. Added conditional attribute definitions for A disables B, B disables C and A disables C
  5. Added A and B (but not C) to a product
  6. Visited the taxonomy term pages to see if there were any glitches in Chrome or IE7

@evilgenius, I tried to reproduce the problem using dev and IE7 but also was unable to find any problems. I used IE9 with the developer tools in IE7 render mode, are you using actual IE7? Perhaps it makes a difference. Please try disabling other modules and see if you can reproduce it using only Ubercart + uc_conditional_attributes. JS errors from other modules on the page may stop JavaScript from executing making it look like uc_conditional_attributes is broken when it may not be.

miccelito’s picture

@stewart.adam

Well, I don't have any issues with the module anymore. My post above is a bit old (July 25).

As far I can remember, your fix in #5 solved most of the IE7 errors.

However, the IE7 error (shown in console) at taxonomy term pages (i.e. /taxonomy/term/[term-id] or /[catpath-raw]) when having conditional attributes added to one node but not having any sort of attribute added to another node when those nodes are within same product classes (content types).
Which I think as far I can remember I solved by adding hidden (display:none) attributes (doesn't have to be conditional) to those other nodes mentioned within same content type.

halloffame’s picture

@stewart.adam Did you take a look at the link? Emailed it to you.