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

When Piwik DB needs to be upgraded, the API should return a valid response #7902

Closed
mattab opened this issue May 13, 2015 · 0 comments
Closed
Assignees
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@mattab
Copy link
Member

mattab commented May 13, 2015

When Piwik sourcecode file have been upgraded to a new version, and user has still not executed the core:update command (or clicked in the UI on Continue to execute the DB upgrades), then the API in the meantime should return a valid API response error.

Reproduce:

  • Increase Piwik version number in Version.php
  • Create a fake update in core/Updates/*.php
  • Open index.php?module=API&method=API.getPiwikVersion&format=xml
  • Got: a 302 redirect to index.php?module=CoreUpdater&method=API.getPiwikVersion&format=xml&action=
  • Expected:
    • HTTP Status code 503,
    • and API call should not redirect. It should instead return a valid eg. XML response that returns the standard API error reponse eg.
<?xml version="1.0" encoding="utf-8" ?>
<result>
    <error message="Database Upgrade Required. Your Piwik database is out-of-date, and must be upgraded before you can continue." />
</result>

Steps:

  • Add test case
  • Fix issue

Related to #7901 #7903

@mattab mattab added the Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. label May 13, 2015
@mattab mattab added this to the 2.15.0 milestone Jul 15, 2015
@tsteur tsteur self-assigned this Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

2 participants