Since I updated, the 'Affect output' checkboxes behave unusually. They all start out with the field disabled (in grey), but the checkbox is checked. Then if I uncheck it, the field turns to white (editable), but I must recheck it so that my changes stay. It gets weirder: when I reopen the edit tab, what should be checked is unchecked and vice versa, and I must uncheck the checked boxes and check the unchecked ones (phew!) so that I get the expected behavior. Must be a strange issue with $flags?

CommentFileSizeAuthor
#5 contemplate.js_.patch408 bytesdenney

Comments

jjeff’s picture

Hmmm... This actually sounds a little more like a javascript issue. Are you running JQuery Update and/or have you updated/changed JQuery in one way or another? Are you running any other non-standard Javascript stuff?

FiReaNGeL’s picture

Yup running Jquery update; I tried to disable it, but the problem is still there. I'll try to check if I run other javascript somewhere; if its only on my part, i can work around it just fine, but its annoying :)

jjeff’s picture

Well dissabling JQuery Update is a bit tricky... if you've got it installed correctly, you should have replaced the core jquery.js file, so you'll need to get the old one back in there when you dissable it.

I've seen the behavior that you're describing before. But I think it was because I didn't have JQuery Update installed correctly.

denney’s picture

I have the same, very annoying, issue. I also have the jQuery update installed and yes, disabling it and replacing the old jquery.js file fixes it but then makes some of my other modules not work. :(

I work around this by "double-checking" the boxes each time I edit a content template. Not an ideal but it works.

denney’s picture

Status: Active » Needs review
StatusFileSize
new408 bytes

I managed to fix this problem by modifying the contemplate.js file.

I don't know if this affects Drupal without the jQuery update as I haven't had time to test it.

It appears to work with the jQuery update though.

FiReaNGeL’s picture

Thanks denney, your patch fixed it on my Jquery updated install.

realityloop’s picture

Thanks Denny, worked for me too

robomalo’s picture

I was having the same problem. The patch worked for me too.

Christefano-oldaccount’s picture

This is working for me, too. Thanks, denney.

Now we only need someone to test it without jQuery Update.

jsm174’s picture

I'm using the newest version of jQuery 1.2.3 even though I'm probably not supposed to.

I was working on a custom latitude/longitude cck module where I needed to do the same kind of thing with a checkbox. I was using this module as a reference. In the contemplate.js:

$(document).ready(function(){
    $("input[@id*=enable]")
      .click(Drupal.contemplate.toggle)
      .click();
  });

I think the second click() actually toggles the checkbox. I imagine it's initial purpose was to get the associated fields in the correct state when the page finished loading?

Anyway, instead of removing the click() like the other patch does, I changed it to use "each":

$(document).ready(function(){
    $("input[@id*=enable]")
      .each(Drupal.contemplate.toggle)
      .click(Drupal.contemplate.toggle);
  });

With this, the page loads, each checkbox calls a Drupal.contemplate.toggle function, the fields get disable if necessary, then the click events are registered.

This seems to work well for me.

-- Jason

nainainai’s picture

thank you so much. this thing bother my for months

Rob T’s picture

Denney's worked for me as well. Thanks for the patch.

jrglasgow’s picture

Status: Needs review » Fixed

denney's patch didn't have any ill effects for me using the original jQuery in Drupal 5.7, so I have commited it. I have also applied this patch to the 6.x port of this module, and it works great.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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