I've put an address field in field collection, the state section is missing after country changed.

CommentFileSizeAuthor
#1 1890962-0.patch728 bytesrogical

Comments

rogical’s picture

Status: Active » Needs review
StatusFileSize
new728 bytes

Simple enhancement solve this.

rogical’s picture

Title: Address field form isn't refreshed well in field collection » Add delta to the wrapper_id to avoid dddress field form isn't refreshed in field collection
rszrama’s picture

Title: Add delta to the wrapper_id to avoid dddress field form isn't refreshed in field collection » Add greater specificity to the address field widget form wrapper ID
Version: 7.x-1.0-beta3 » 7.x-1.x-dev
Component: User interface » Code
Category: bug » task
Status: Needs review » Active

I can't reproduce this issue. The state list updates just fine when using a multi-value address field inside a Field Collection (or just attached to a Node for that matter).

That said, it's still invalid HTML to have two elements on the page with the same ID. If you're truly experiencing collision issues on refresh, even this change would seem to be insufficient, because if you have two address fields on the form they'd presumably still have IDs that collided (two addressfield-wrapper-0, ...-1, etc.).

So the real question is - how do we ensure a unique wrapper ID? I suppose we can include both the instance name and delta value - that should get us most of the way there, though it's still feasible to have duplicates (i.e. if you had a multi-value field collection w/ an address field in it on the form).

Additionally, this patch should make sure field related data can be found in the $context array. It's not guaranteed to be there, because the same form building function can be used outside of the Field API.

bojanz’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)