Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a XML that has multiple occurrances of the same item like this:
<root>
<person>
<ref value="A" />
<ref value="B" />
<ref value="C" />
</person>
<person>
<ref value="A" />
<ref value="D" />
</person>
<person>
<ref value="E" />
<ref value="H" />
</person>
...
</root>
I want to migrate the ref-values as sub-values into a field that allows multiple values.
Person1
References
A
B
C
etc.
I can up set field_reference with the xpath "ref/@value", but do to a loop in fetchNextRow() in
class Xml extends DataParserPluginBase implements ContainerFactoryPluginInterface
I would only get the last value
Any suggestions on how to fix this would be welcome.
Comment | File | Size | Author |
---|---|---|---|
#3 | interdiff.txt | 771 bytes | mikeryan |
#3 | xml_multiple_values-2730375-3.patch | 8.05 KB | mikeryan |
#2 | xml_multiple_values-2730375-2.patch | 7.19 KB | mikeryan |
Comments
Comment #2
mikeryanYep, the attached patch adds a multi-value field to the example wine_variety_multi_xml migration that demonstrates this - definitely a bug.
Comment #3
mikeryan@killes@www.drop.org: Does this work for you?
Comment #4
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedYes, thank you, this works!
Comment #6
mikeryanCommitted, thanks!