The error problem is being introduced when I extend the API to then “Export CSV File”
BEFORE that action is added to this API I successfully get back data in the browser like this –
{"query":[
{"apo_Kunden_ID":740770,"Apothekenname":"Greif-Apotheke","Strasse":"Hannes-Meyer-Platz 25","PLZ":18146,"Ort":"Rostock","inhouse_training":null,"peremail":null,"partner":null,"kontakt_email":null},{"apo_Kunden_ID":741220,"Apothekenname":"Schlo\u00df Apotheke Tegel","Strasse":"Berliner Str. 6","PLZ":13507,"Ort":"Berlin","inhouse_training":null,"peremail":null,"partner":null,"kontakt_email":null},
{"apo_Kunden_ID":501556,"Apothekenname":"Bad-Apotheke Binz","Strasse":"Friedrich-Ebert-Str. 5","PLZ":18609,"Ort":"Ostseebad Binz","inhouse_training":"Ja","peremail":"Ja","partner":"Harlan Sanders","kontakt_email”:”sanders@xahoo.com"}]}
I then add to the same query this and save – this time with no header & the query itself was checked for Output but not checked for “debug”–
Then I ask for the browser output –
{"code":0,"file":"\/Users\/developer\/Sites\/localhost\/trainings\/dmxConnectLib\/modules\/export.php","line":29,"message":"Data is not an array.","trace":"#0 \/Users\/developer\/Sites\/localhost\/trainings\/dmxConnectLib\/lib\/App.php(195): modules\\export->csv(Object(stdClass), 'myexport', NULL)\n#1 \/Users\/developer\/Sites\/localhost\/trainings\/dmxConnectLib\/lib\/App.php(159): lib\\App->execSteps(Object(stdClass))\n#2 \/Users\/developer\/Sites\/localhost\/trainings\/dmxConnectLib\/lib\/App.php(127): lib\\App->execSteps(Array)\n#3 \/Users\/developer\/Sites\/localhost\/trainings\/dmxConnectLib\/lib\/App.php(116): lib\\App->exec(Object(stdClass), false)\n#4 \/Users\/developer\/Sites\/localhost\/trainings\/dmxConnectLib\/lib\/App.php(94): lib\\App->exec(Object(stdClass))\n#5 \/Users\/developer\/Sites\/localhost\/trainings\/dmxConnect\/api\/trainingformonly.php(8): lib\\App->define(Object(stdClass))\n#6 {main}"}