...or some combination like this :-/

Basically, the last bit of Javascript in og_menu.js seems to throw Internet Explorer 7/8/9 for a loop (causing two errors as described in #1051454: Attached JS file causes JS errors in IE 7, 8, 9), and this causes a few odd behaviors to happen on node add/edit forms. First, the WYSIWYG editor won't attach to the body field anymore, and second, some of the buttons in FileField fieldsets were displaying funny.

This bug only affects IE 7/8/9, and simply commenting out these lines in og_menu.js fixed the problem (with no ill effect) for me (while leaving jQuery Update 2.x, WYSIWYG, and WYSIWYG Force Linebreaks enabled):

  // if ($('.og-audience:checkbox').size()) {
  //   $('.og-audience:checkbox').change(toggleCheckboxes).ready(toggleCheckboxes);
  // }

It seems to me that that entire portion of the JS code seems a little hackish—but I'm not JS expert, so I'm out of my league in trying to fix it. For most nodes on my particular site, there's only one group audience, so there are no checkboxes, and no list of selectable groups, just a little display of the group the post is in. Therefore the error: 'undefined' is null or not an object.

I'm wondering if this code could be cleaned up in such a way as to resolve this bug, plus the one in #993518: JS Error when Audience becomes a Select.

Comments

jide’s picture

Thanks, I'll have a look at this.

aidanlis’s picture

And this line:
if ($('.menu-title-select option[value='+originalParent+']')) {

Should be:
if ($('.menu-title-select option[value="'+originalParent+'"]')) {

aidanlis’s picture

Title: Module causes JS errors when used with jQuery Update, WYSIWYG, and WYSIWYG Force Linebreaks » Incompatibility with jQuery Update. Problems with WYSIWYG, WYSIWYG Force Linebreaks, and "Delete this menu item." being checked.
Status: Active » Needs review
StatusFileSize
new1.07 KB

So in jQuery > 1.3, when you do .attr('checked', '') it's the same as .attr('checked', 'checked') ... what we really want is removeAttr. I've attached a patch which fixes this.

The symptoms of this are the "Delete this menu item." box being checked by default.

erez111’s picture

Status: Needs review » Fixed
Issue tags: +og menu, +og menu javascript, +og_menu

This is a mandatory patch.

I had the exact same problem, not only with ie browsers and I found out the same solution.
Adding both '"' solves the javascript error.
Replace class removal method, is fine.

erez111’s picture

Status: Fixed » Patch (to be ported)
rj’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev

In D7, ckeditor (through wysiwyg module) was not displaying until fix from #2 was applied.

rv0’s picture

Status: Patch (to be ported) » Fixed

committed the fix as suggested in #6 to 7.x-2.x-dev

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ericras’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Closed (fixed) » Patch (to be ported)

The change in #2 needs porting to 7.x-3.x-dev

rv0’s picture

To anyone reading this: don't bother writing a new patch for 7.x-3.x
The javascript has been completely rewritten and will be committed soon.

mpotter’s picture

StatusFileSize
new693 bytes

I know you said not to submit a patch, but I need to anyway. I need a patch on drupal.org to run my project make file. So here it is for 7.x-3.x in case anybody else needs it while we are waiting for the new javascript.

rv0’s picture

Status: Patch (to be ported) » Fixed

Since there's new code in dev which is entirely different, this doesn't seem to apply

Status: Fixed » Closed (fixed)
Issue tags: -og menu, -og menu javascript, -og_menu

Automatically closed -- issue fixed for 2 weeks with no activity.