SitesManager.updateSite succeeds for unknown idsite #1585

Closed
anonymous-piwik-user opened this Issue Aug 14, 2010 · 5 comments

2 participants

@anonymous-piwik-user

The response for SitesManager.updateSite is wrong. Calling it with an unknown idSite parameter results in

{"result":"success", "message":"ok"}

http://example.com/?module=API&idSite=124&format=JSON&token_auth=YOUR_TOKEN&method=SitesManager.updateSite&idSite=124&siteName=foo&urls=http%3A%2F%2Fwhatever.com

This makes no sense - and can't IMHO not be deserved, as delteSite returns

{"result":"error", "message":"website id = 124 not found"}

on error.

Thanks for your work!
Steffen

@anonymous-piwik-user

Attachment: Patch file
1585.diff

@anonymous-piwik-user

To may be speed it up a bit and make your life easier :) I've attached a patch, which adds the same check, which is also done in deleteSite()

@robocoder

Thanks, but getAllSitesId() requires superuser access. Some refactoring needs to be done.

@robocoder

(In [2928]) fixes #1585

@robocoder

(In [2977]) refs #1585, refs #1638 - merged from trunk

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment