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

API method API.getBulkRequest converts whitespace to HTML entities #3970

Closed
tsteur opened this issue Jun 2, 2013 · 5 comments
Closed

API method API.getBulkRequest converts whitespace to HTML entities #3970

tsteur opened this issue Jun 2, 2013 · 5 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Jun 2, 2013

Hi,

I'm displaying some properties from Live.getLastVisitDetails in Mobile App. When requesting this method via BulkRequests, it converts some content to HTML entities.

timeSpentPretty: "2 min 8s"

For instance visitDurationPretty and timeSpentPretty . I cannot reproduce this behavior when executing plain Live.getLastVisitDetails action (no BulkRequest).

In Mobile App I cannot resolve HTML entities. Can we either not convert anything or convert them to Unicode (\u0000)?

Plain request (replace token_auth to reproduce):
http://demo.piwik.org/?module=API&method=Live.getLastVisitsDetails&idSite=1&period=day&date=today&format=JSON&token_auth=XXXXXXX

With BulkRequest (replace token_auth to reproduce):
http://demo.piwik.org/index.php?urls%5B0%5D=method%3dLive.getCounters%26lastMinutes%3d30%26format%3dJSON%26idSite%3d1%26&urls%5B1%5D=method%3dLive.getCounters%26lastMinutes%3d1440%26format%3dJSON%26idSite%3d1%26&urls%5B2%5D=method%3dLive.getLastVisitsDetails%26filter_limit%3d20%26period%3dday%26date%3dtoday%26format%3dJSON%26idSite%3d1%26&module=API&date=today&token_auth=XXXXXXXXXX&period=day&format=json&method=API.getBulkRequest&language=en&

@mattab
Copy link
Member

mattab commented Jun 3, 2013

I know this is not an acceptable answer :p but what about such function? http://stackoverflow.com/questions/5796718/html-entity-decode/9609450#9609450

@tsteur
Copy link
Member Author

tsteur commented Jun 3, 2013

Yes, not acceptable :) I do not have a DOM in native mobile app ;) And we should avoid as much computation on mobile as possible ;)

@tsteur
Copy link
Member Author

tsteur commented Oct 30, 2013

In 229e04c: refs #3970 this should fix html entities are returned in json output

@tsteur
Copy link
Member Author

tsteur commented Oct 30, 2013

In 9206f7d: refs #3970 this should fix some bulk requests are not correct rendered because there is an array of dataTables

@tsteur
Copy link
Member Author

tsteur commented Oct 30, 2013

In 68b8ccb: refs #3970 probably a better fix for html entities in json output, fixes bulkRequest is buggy with PHP and other renderers

@tsteur tsteur added this to the 2.0 - Piwik 2.0 milestone Jul 8, 2014
@tsteur tsteur self-assigned this Jul 8, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
…ct rendered because there is an array of dataTables
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
…output, fixes bulkRequest is buggy with PHP and other renderers
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants