When the same repeatable date field appears in multiple entity forms on a single page, the Repeat checkbox does not work as expected. Clicking "Repeat" for the first checkbox opens or closes ALL repeat API fieldsets on the entire page, rather than just the single fieldset associated with that specific checkbox. Clicking the second, third, etc. Repeat checkbox doesn't do anything at all.

The reason appears to be that the name for the Repeat checkbox is clashing with other Repeat checkboxes on the page.

Comments

justin2pin’s picture

Status: Needs work » Needs review
StatusFileSize
new1.52 KB

Potential fix attached. Minimally tested, appears to work as expected.

Status: Needs review » Needs work

The last submitted patch, date_repeat_api-resolve_name_clash-1675844.patch, failed testing.

mpdonadio’s picture

Issue summary: View changes
StatusFileSize
new1.29 KB

Attached is a re-roll against the latest dev. It changes everything to be relative to the module, not sites (so the testbot should be able to apply it), and also inverts the logic to match how states is currently handled in the -dev version.

However, this does not work for me. Hopefully someone can use the reroll as a starting point to fix the selectors if I don't get a chance.

mpdonadio’s picture

Status: Needs work » Needs review
StatusFileSize
new711 bytes

OK, here is another attempt.

The -DEV version assumes fields are directly on the entity whose form is being displayed, and hardcodes the parent chain for the selector. This patch will work through the whole $element['#parents'] to come up with the proper input[name] selector to target.

This works for me with a repeatable date field inside a field collection, which is also repeatable on the node. Repeat all the dates!

Status: Needs review » Needs work

The last submitted patch, 4: date_repeat_api-resolve_name_clash-1675844-04.patch, failed testing.

mpdonadio’s picture

Version: 7.x-2.5 » 7.x-2.x-dev
Status: Needs work » Needs review

Resetting version to see if this patch will apply.

mpdonadio’s picture

paravibe’s picture

Assigned: Unassigned » paravibe
Issue tags: +dcuacs2015
paravibe’s picture

StatusFileSize
new717 bytes

Rerolled

valentine94’s picture

Looks nice, thanks!

+1 to RTBC

podarok’s picture

Thanks, merged

  • podarok committed e37620a on 7.x-2.x authored by paravibe
    Issue #1675844 by mpdonadio, justin2pin, paravibe, Valentine94: The "...
podarok’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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