When checking checkbox container disappears.
when unchecking it appears, like screenshots..or am i missing something here?

Comments

ParisLiakos’s picture

Version: 7.x-2.6 » 7.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new597 bytes

Well thats weird but if i switch #state from visible to invisible it works...i guess a core bug? dunno, but if someones has the same problem try this patch

Status: Needs review » Needs work

The last submitted patch, 1810734-date_repeat_checkboxes_work_reversed-1.patch, failed testing.

ParisLiakos’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1810734-date_repeat_checkboxes_work_reversed-1.patch, failed testing.

ParisLiakos’s picture

Status: Needs work » Needs review

w/e a migration exception..which is irrelevant with my one-line change

saratt’s picture

Hi, I am having this issue now, were you able to find a solution. Thanks.

ParisLiakos’s picture

Status: Needs review » Needs work

@st455 did you try my patch at #1?

saratt’s picture

@ParisLiakos, yes I did try that and it fixed it. I did notice another issue too. Even the exclude and include dates checkboxes were working in an opposite way i.e when i check Exclude dates checkbox the field for include dates was being enabled.

I figured the source of my issue was the jquery update. The issues i mentioned above started popping up when jquery was updated from 1.4.4 to 1.6.3. Downgrading jquery fixed the issues, didn't even have to apply the patch.

Thank you for the patch though.

ParisLiakos’s picture

Title: Repeat checkboxes working reversed » Repeat checkboxes working reversed with updated jQuery

aah..thanks for your feedback! i have updated jquery too..i guess thats why

Renee S’s picture

Status: Needs work » Reviewed & tested by the community

So, this issue is happening with jQuery 1.6+. This fix worked for me. I extended it to additional/exception checkboxes as well, as they are also messed-up. (Looking in drupal_process_states it seems like it *should* work with visible, but... yeah, it doesn't. "visible" without a corresponding "invisible" appears to work fine on the radios and selects, but not the checkboxes, as far as I can tell. But just "invisible" is all that's needed.)

Tested on a fresh install with 1.5 and changing it to invisible/FALSE works in 1.5 as well. Is there any reason not to specify the inverse for users of jQuery 1.5 and below?

Implementing this fix would provide forward-and-backward compatibility and support anybody using higher jQueries.

cafuego’s picture

cafuego’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x-2.x.

Renee S’s picture

Quick question, cafuego, did you commit the patch as is? This also happens with Additional/Exception checkboxes, which isn't addressed in the patch above. I can roll a patch for that also if needed.

cafuego’s picture

Yup, I applied the patch from #1 as-is. Just re-open this issue and add the patch for the extra bit if you want.

Status: Fixed » Closed (fixed)

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

cmonnow’s picture

Issue summary: View changes

Just for closure - the patch that was created for the related issue in ParisLiakos's link in #16 does in fact fix this issue (that is, the include/exclude bug that wasn't fixed here).

It's just a single line in core that changes "this.attr('checked')" to "this.is(':checked')" (https://www.drupal.org/files/states_0.patch).