Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trim() expects parameter 1 to be string, array given #51

Open
Manaus opened this issue Mar 21, 2016 · 7 comments
Open

trim() expects parameter 1 to be string, array given #51

Manaus opened this issue Mar 21, 2016 · 7 comments

Comments

@Manaus
Copy link

Manaus commented Mar 21, 2016

sym_error
Hello, I'm trying to import a Xml (valid) source to the app, but I get this error.
I have no idea where the error resides,
I put in the xpath fields of the Xml Importer recipe values such as /root/article/title
This is the feed

Thanks for any suggestion

@nitriques
Copy link
Member

Which version of Symphony ?

Also, can you add a var_dump($data);die; calls at line 158 ?

@Manaus
Copy link
Author

Manaus commented Mar 22, 2016

Hi @nitriques ,
this is the result of the dump

array(176) { [0] => string(50) "" [1] => string(51) "" [2] => string(54) "" [3] => string(42) "" [4] => string(44) "" [5] => string(43) "" [6] => string(37) "" [7] => string(72) "" [8] => string(72) "" [9] => string(59) "" [10] => string(44) "" [11] => string(55) "" [12] => string(115) "" [13] => string(47) "" [14] => string(85) "" [15] => string(51) "" [16] => string(39) "" [17] => string(71) "" [18] => string(58) "" [19] => string(53) "" [20] => string(46) "" [21] => string(37) "" [22] => string(38) "" [23] => string(20) "" [24] => string(50) "" [25] => string(78) "" [26] => string(66) "" [27] => string(38) "" [28] => string(59) "" [29] => string(82) "" [30] => string(35) "" [31] => string(35) "" [32] => string(35) "" [33] => string(35) "" [34] => string(35) "" [35] => string(35) "" [36] => string(68) "" [37] => string(56) "" [38] => string(45) "" [39] => string(45) "" [40] => string(41) "" [41] => string(52) "" [42] => string(74) "" [43] => string(38) "" [44] => string(38) "" [45] => string(38) "" [46] => string(48) "" [47] => string(47) "" [48] => string(87) "" [49] => string(99) "" [50] => string(55) "" [51] => string(27) "" [52] => string(50) "" [53] => string(85) "" [54] => string(70) "" [55] => string(72) "" [56] => string(22) "" [57] => string(50) "" [58] => string(61) "" [59] => string(55) "" [60] => string(64) "" [61] => string(89) "" [62] => string(102) "" [63] => string(66) "" [64] => string(52) "" [65] => string(48) "" [66] => string(48) "" [67] => string(48) "" [68] => string(61) "" [69] => string(59) "" [70] => string(47) "" [71] => string(77) "" [72] => string(47) "" [73] => string(37) "" [74] => string(73) "" [75] => string(41) "" [76] => string(64) "" [77] => string(58) "" [78] => string(41) "" [79] => string(41) "" [80] => string(82) "" [81] => string(72) "" [82] => string(101) "" [83] => string(85) "" [84] => string(64) "" [85] => string(54) "" [86] => string(38) "" [87] => string(57) "" [88] => string(60) "" [89] => string(53) "" [90] => string(45) "" [91] => string(48) "" [92] => string(67) "" [93] => string(20) "" [94] => string(90) "" [95] => string(86) "" [96] => string(85) "" [97] => string(53) "" [98] => string(28) "" [99] => string(49) "" [100] => string(50) "" [101] => string(51) "" [102] => string(79) "" [103] => string(67) "" [104] => string(37) "" [105] => string(61) "" [106] => string(50) "" [107] => string(46) "" [108] => string(57) "" [109] => string(50) "" [110] => string(36) "" [111] => string(49) "" [112] => string(58) "" [113] => string(51) "" [114] => string(61) "" [115] => string(63) "" [116] => string(43) "" [117] => string(36) "" [118] => string(105) "" [119] => string(50) "" [120] => string(32) "" [121] => string(32) "" [122] => string(33) "" [123] => string(74) "" [124] => string(57) "" [125] => string(55) "" [126] => string(70) "" [127] => string(44) "" (more elements)... }

@nitriques
Copy link
Member

Which field is the input field ? What's your xpath expression ? /root/article ?

@Manaus
Copy link
Author

Manaus commented Mar 23, 2016

Sorry I didnt mention the Sym version: 2.6.7
Title field is a text field,
expression is /root/article/title
Thanks

@nitriques
Copy link
Member

That's the problem.

AS per: https://github.com/symphonists/xmlimporter#source

Source should be /root/article

As for the field (destination https://github.com/symphonists/xmlimporter#destination) it should be:

tite/text()

But the importer should throw a better exception when multiple values are found...

@Manaus
Copy link
Author

Manaus commented Mar 24, 2016

@nitriques Sorry my fault, I should have RTFM...! Thanks for your time, now it works.

@Manaus Manaus closed this as completed Mar 24, 2016
@nitriques
Copy link
Member

Great!

I'll reopen since

the importer should throw a better exception when multiple values are found...

@nitriques nitriques reopened this Mar 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants