Closed (won't fix)
Project:
Geolocation Field
Version:
7.x-1.x-dev
Component:
Geolocation Field / Backend
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Apr 2012 at 22:17 UTC
Updated:
12 Apr 2022 at 09:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jojonaloha commentedI've attached a patch that resolves the issue for me, but not sure if it is the best way to go about it.
Comment #2
dvega commentedThank you very much, it works!
Comment #3
derjochenmeyer commented@jojonaloha: could you please explain how the patch solves the issue.
thanks! :)
Comment #4
jojonaloha commentedIt's been awhile, but since the Field Collection module is a fieldable entity, the array looks something like this (from memory):
$node->$field_collection_name[$parent_delta][$field_name][$delta] = array('value' => '', ... etc);
And so by just using the $instance['id'] and $delta, it is always something like 'googlemap-0', creating duplicate HTML id's and then only the first instance loads, I think. By adding the $parent_delta in there it becomes 'googlemap-0-0', 'googlemap-1-0', etc and if the field is multivalued then it would be incremented as well. The dash in between is important to avoid conflicts with something like googlemap-11-0 vs googlemap-1-10
Hope that helps.
Comment #5
derjochenmeyer commentedThanks for the clarification. Shouldn't this code be wrapped in something like ...
Comment #6
jojonaloha commentedI suppose it could be wrapped in a module_exists(), but since we aren't relying on any field_collection functions I don't think it's necessary.
Comment #7
derjochenmeyer commentedHowever, makes sense. Thanks! Committed to 7.x-1.x-dev
http://drupalcode.org/project/geolocation.git/commit/4f0d565
Comment #8
derjochenmeyer commentedIs possible to have a more generic approach. Is field collection the only module/case where we have to consider
$element['#field_parents']?Comment #9
jojonaloha commentedThat's a good question. It may have been fine to just do something like (example diff):
I haven't tested this, but it is probably better long-term to have a more generic solution, as there may be other modules that create nested fields like this.
Comment #10
derjochenmeyer commentedComment #11
rp7 commentedAccording to me, the fix does not cover nested field collections. Newly attached patch should fix this.
Comment #13
derjochenmeyer commentedThis patch needs a reroll.
Comment #15
christianadamski commentedClosing all 7.x issues. It's time.