- def to_xml_node(visible_members = nil, changeset_cache = {}, user_display_name_cache = {})
- el1 = XML::Node.new 'relation'
- el1['id'] = self.id.to_s
- add_metadata_to_xml_node(el1, self, changeset_cache, user_display_name_cache)
-
- self.relation_members.each do |member|
- p=0
- if visible_members
- # if there is a list of visible members then use that to weed out deleted segments
- if visible_members[member.member_type][member.member_id]
- p=1
- end
- else
- # otherwise, manually go to the db to check things
- if member.member.visible?
- p=1
- end
- end
- if p
- e = XML::Node.new 'member'
- e['type'] = member.member_type.downcase
- e['ref'] = member.member_id.to_s
- e['role'] = member.member_role
- el1 << e
- end
+ # member_ref = member['ref']
+ # member_role
+ member["role"] ||= "" # Allow the upload to not include this, in which case we default to an empty string.
+ relation.add_member(member["type"].classify, member["ref"], member["role"])