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

Ensure to also install plugins when there is a POST request #12619

Merged
merged 2 commits into from Mar 16, 2018

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Mar 15, 2018

I'm not sure if this was implemented like this on purpose? But currently we wouldn't be installing any plugin until a request is posted. This can cause various problems for example when a new plugin is activated, but then the user only POSTS requests to API. This requests will then possibly fail as the plugin is not installed.

@tsteur tsteur added Bug For errors / faults / flaws / inconsistencies etc. Needs Review PRs that need a code review labels Mar 15, 2018
|| empty($_GET['action'])
|| $_GET['module'] !== 'Installation'
|| !in_array($_GET['action'], array('getInstallationCss', 'getInstallationJs'))) {
$module = Common::getRequestVar('module', false, 'string');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

combination of default value false and variable type string doesn't make much sense, as it will always result in an empty string as returned default value (as it will be casted to string)

Also wondering if we maybe should use Piwik::getModule() and Piwik::getAction() here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

combination of default value false and variable type string doesn't make much sense, as it will always result in an empty string as returned default value (as it will be casted to string)

I know, it's still empty though and we use it in various places like this.

Using Piwik:getModule etc makes sense 👍

@sgiehl sgiehl merged commit c187fa1 into 3.x-dev Mar 16, 2018
@sgiehl sgiehl deleted the installpluginspost branch March 16, 2018 12:55
InfinityVoid pushed a commit to InfinityVoid/matomo that referenced this pull request Oct 11, 2018
…rg#12619)

* Ensure to also install plugins when there is a POST request

* reuse existing methods
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. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants