Skip to content

Loading…

Calling API with serialize=0, get: Array to string conversion in core/dispatch.php on line 37 #5144

Closed
mattab opened this Issue · 1 comment

1 participant

@mattab
Piwik Open Source Analytics member

This was reported in the forums

Can be reproduced locally with: http://localhost/piwik-master/index.php?module=API&method=API.get&format=PHP&idSite=1&period=day&date=2014-05-02,2014-05-11&expanded=1&token_auth=XXXXXXXX&filter_limit=30&serialize=0

Notice: Array to string conversion in core/dispatch.php on line 37

@mattab
Piwik Open Source Analytics member

In 97402e9: Fixes #5144 When the response being dispatched is an array, var_export it instead of echo

@mattab mattab added this to the 2.3.0 - Piwik 2.3.0 milestone
@mattab mattab self-assigned this
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue
@mattab mattab Fixes #5144 When the response being dispatched is an array, `var_expo…
…rt` it instead of `echo`
97402e9
@tsteur tsteur added a commit that referenced this issue
@tsteur tsteur refs #5144 better fix for array to string to conversion.
Noticed this hack while I worked on the tracker refactoring. Dispatch
should always return a string. Fixing the problem where it actually occurs.
An even better fix would be not to support serialize=0 for format PHP as
it is meant only for internal requests. If someone wants to access data
serialize=1 should be set.
54ce7af
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.