When importing a feed I'm able to successfully import a xpath node into a custom field I created called "Name". However when I try to import that same xpath node into Title, the value of Title just becomes "Array". So when importing 9 items, I have 9 Drupal content items that all have the title "Array". Any idea what's going on here? Why would it be able to parse the xpath correctly to a custom field but not to the default Title field. I'm in D7 with all modules and core up to date.
context: //dlf:item
title: //ncip:CallNumber (spits out "Array")
field_name: //ncip:CallNumber (spits out the actual value of the xpath node specified, like "iPod")
Attached sample XML. Submitting as a bug report but could very well be something I've done wrong.
Comments
Comment #1
twistor CreditAttribution: twistor commentedCan you try,
title: //ncip:CallNumber[1]
.Also, your sample XML got eaten. Try wrapping it in
<code>
.Comment #2
cdmo CreditAttribution: cdmo commentedThanks for the quick reply.
Tried //ncip:CallNumber[1] and am still getting "Array"... though it is working for the other field_name field. Screenshot: https://dl-web.dropbox.com/get/Public/Screen%20Shot%202011-09-30%20at%20...
Here's the XML (apologies for length):
Comment #3
twistor CreditAttribution: twistor commentedlet's see
context: //dlf:item
title: ncip:LookupItemResponse/ncip:UniqueItemId/ncip:BibliographicDescription/ncip:ItemDescription/ncip:CallNumber
Either way, you don't want //ncip:CallNumber. That will return all the fields in the whole file.
could work as well. Notice the dot.
Comment #4
cdmo CreditAttribution: cdmo commentedLooks like the dot is what was needed. All fields are populating correctly, including my unique GUID which was having the same "Array" problem as the Title field. It's updating on import as well (instead of just adding duplicates). This is all set, thanks twistor.
Comment #5
d.holmen@gmail.com CreditAttribution: d.holmen@gmail.com commentedI Still have this issue.
My XML:
None of these can be used as title without having it named as "Array".
And it is worth noticing, that the debug of the title field shows the correct data that I want.
Comment #6
jorisx CreditAttribution: jorisx commentedGot the same problem here ...
Did you ever solve this?
Comment #7
peterpearson CreditAttribution: peterpearson commentedI ran into this issue with creation dates while parsing XML. It turned out there were two fields with the same name so an array was being returned. Either fix the feed or return an item in your array e.g. field[@name="created_at"][1]
I guess this would also occur if set the base context was set wrong and there were multiple feed items being scanned each time. Alternatively if the feed markup was mismatched you might get something similar as the context would be picking up the wrong thing.