{"action":"created","issue":{"url":"https://api.github.com/repos/medic/medic-webapp/issues/2146","repository_url":"https://api.github.com/repos/medic/medic-webapp","labels_url":"https://api.github.com/repos/medic/medic-webapp/issues/2146/labels{/name}","comments_url":"https://api.github.com/repos/medic/medic-webapp/issues/2146/comments","events_url":"https://api.github.com/repos/medic/medic-webapp/issues/2146/events","html_url":"https://github.com/medic/medic-webapp/issues/2146","id":144673745,"number":2146,"title":"Inputs are not assigned properly when field name is not unique","user":{"login":"abbyad","id":789512,"avatar_url":"https://avatars.githubusercontent.com/u/789512?v=3","gravatar_id":"","url":"https://api.github.com/users/abbyad","html_url":"https://github.com/abbyad","followers_url":"https://api.github.com/users/abbyad/followers","following_url":"https://api.github.com/users/abbyad/following{/other_user}","gists_url":"https://api.github.com/users/abbyad/gists{/gist_id}","starred_url":"https://api.github.com/users/abbyad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abbyad/subscriptions","organizations_url":"https://api.github.com/users/abbyad/orgs","repos_url":"https://api.github.com/users/abbyad/repos","events_url":"https://api.github.com/users/abbyad/events{/privacy}","received_events_url":"https://api.github.com/users/abbyad/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/medic/medic-webapp/labels/2%20-%20Active%20Work","name":"2 - Active Work","color":"bfd4f2"},{"url":"https://api.github.com/repos/medic/medic-webapp/labels/Bug","name":"Bug","color":"c10c02"},{"url":"https://api.github.com/repos/medic/medic-webapp/labels/Priority","name":"Priority","color":"ff0022"}],"state":"open","locked":false,"assignee":{"login":"SCdF","id":583851,"avatar_url":"https://avatars.githubusercontent.com/u/583851?v=3","gravatar_id":"","url":"https://api.github.com/users/SCdF","html_url":"https://github.com/SCdF","followers_url":"https://api.github.com/users/SCdF/followers","following_url":"https://api.github.com/users/SCdF/following{/other_user}","gists_url":"https://api.github.com/users/SCdF/gists{/gist_id}","starred_url":"https://api.github.com/users/SCdF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SCdF/subscriptions","organizations_url":"https://api.github.com/users/SCdF/orgs","repos_url":"https://api.github.com/users/SCdF/repos","events_url":"https://api.github.com/users/SCdF/events{/privacy}","received_events_url":"https://api.github.com/users/SCdF/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/medic/medic-webapp/milestones/48","html_url":"https://github.com/medic/medic-webapp/milestones/Iteration%202016-13:%20Feature%20Freeze","labels_url":"https://api.github.com/repos/medic/medic-webapp/milestones/48/labels","id":1658610,"number":48,"title":"Iteration 2016-13: Feature Freeze","description":"","creator":{"login":"browndav","id":763977,"avatar_url":"https://avatars.githubusercontent.com/u/763977?v=3","gravatar_id":"","url":"https://api.github.com/users/browndav","html_url":"https://github.com/browndav","followers_url":"https://api.github.com/users/browndav/followers","following_url":"https://api.github.com/users/browndav/following{/other_user}","gists_url":"https://api.github.com/users/browndav/gists{/gist_id}","starred_url":"https://api.github.com/users/browndav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/browndav/subscriptions","organizations_url":"https://api.github.com/users/browndav/orgs","repos_url":"https://api.github.com/users/browndav/repos","events_url":"https://api.github.com/users/browndav/events{/privacy}","received_events_url":"https://api.github.com/users/browndav/received_events","type":"User","site_admin":false},"open_issues":24,"closed_issues":14,"state":"open","created_at":"2016-03-21T22:32:08Z","updated_at":"2016-04-03T22:11:10Z","due_on":"2016-04-01T07:00:00Z","closed_at":null},"comments":4,"created_at":"2016-03-30T18:01:51Z","updated_at":"2016-04-04T15:44:42Z","closed_at":null,"body":"With our XForm notation for inputs, and assigning `content.contact` in a task, we can have a form with `contact.parent.contact.phone` assigned to `/assessment_follow_up/inputs/contact/parent/contact/phone`. From what we've seen, this works as long as there is not also `contact.phone` field. If there is, the `contact.phone` value is assigned to the xform field instead of the parent's.\r\n\r\nWe need to respect the full path to avoid assigning incorrect values."},"comment":{"url":"https://api.github.com/repos/medic/medic-webapp/issues/comments/205358731","html_url":"https://github.com/medic/medic-webapp/issues/2146#issuecomment-205358731","issue_url":"https://api.github.com/repos/medic/medic-webapp/issues/2146","id":205358731,"user":{"login":"SCdF","id":583851,"avatar_url":"https://avatars.githubusercontent.com/u/583851?v=3","gravatar_id":"","url":"https://api.github.com/users/SCdF","html_url":"https://github.com/SCdF","followers_url":"https://api.github.com/users/SCdF/followers","following_url":"https://api.github.com/users/SCdF/following{/other_user}","gists_url":"https://api.github.com/users/SCdF/gists{/gist_id}","starred_url":"https://api.github.com/users/SCdF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SCdF/subscriptions","organizations_url":"https://api.github.com/users/SCdF/orgs","repos_url":"https://api.github.com/users/SCdF/repos","events_url":"https://api.github.com/users/SCdF/events{/privacy}","received_events_url":"https://api.github.com/users/SCdF/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T15:44:42Z","updated_at":"2016-04-04T15:44:42Z","body":"Unfortunately we:\r\n - need this current structure. It's not like the data and the xml are 1:1 right now, so correct binding depends on being able to bound to arbitrarily deep children\r\n - can't make up rules like \"if there is already data in that element ignore this data\" because there are examples where the form elem has default values we want to override\r\n\r\nWe *might* be able to have the rule that if that data is empty ignore it, which could possibly solve the linked phone number issue, but may not actually be a sound rule (because maybe wiping a default value is exactly what you wanted.\r\n\r\nAnother option would be some kind of record of what you've already set, so that you never bind the same value twice, along with making sure you always bind depth first (so the most \"correct\" or \"specifc\" value always binds first, and less specific values are ignore)."}}