[Solved] Problem importing with XML Importer: trim() expects parameter 1 to be string, array given
This is an open discussion with 3 replies, filed under Extensions.
Search
some screenshots
Do you have any required fields in your section that are empty in the XML you are trying to import? I have encountered this on 2 local installs and it was due to empty strings being required and the validation not picking it up.
I did have some required fields but none of them were empty in the XML I was trying to import. However, I don't know why but after I removed all the fields in my section and added them again the error is gone and everything works like a charm! Thanks anyway.
Create an account or sign in to comment.
I know this problem has been mentioned a couple of times before but i believe this is slightly different.
I'm importing an external XML feed which contains data about travel deals. After a couple of errors (and solving them by Brendo's update) I finally got the XML importer extension working and successfully importing data.
I matched one field at a time and executed the importer after adding a new field every time so I would notice if (and when) something went wrong again and it did after like the fourth field.
I read somewhere that the Xpath Expression should be: fieldname/text() and untill now this worked perfectly fine. Then the error came back:
I figured out that the Xpath Expression: fieldname/text()[ 1 ] solved this and the data was properly imported.
Then the error came back again with a field that contained exactly the same sort of content (accomodation_type). However the text()[ 1 ] solution didn't work for this field.
Does anyone know what is happening here? Would really appreciate someone helping me out here!