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

Website>Manager "Use Global site search parameters" does not get saved #10971

Closed
mattab opened this issue Dec 6, 2016 · 2 comments · Fixed by #11022
Closed

Website>Manager "Use Global site search parameters" does not get saved #10971

mattab opened this issue Dec 6, 2016 · 2 comments · Fixed by #11022
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Dec 6, 2016

As reported in #10412 (comment)

In Websites > Manage, when editing a website, clicking the checkbox "Use Global site search parameters" does not get saved (the checkbox stays empty after clicking save).

use default site search parameters

@mattab mattab added the Regression Indicates a feature used to work in a certain way but it no longer does even though it should. label Dec 6, 2016
@mattab mattab added this to the 3.0.0-rc milestone Dec 6, 2016
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Dec 6, 2016
@sgiehl
Copy link
Member

sgiehl commented Dec 6, 2016

Reason for that is https://github.com/piwik/piwik/blob/3.x-dev/plugins/WebsiteMeasurable/MeasurableSettings.php#L257-L259

Seems somehow to be on purpose, that the value isn't saved.
@tsteur any reason for that? Or can it simply be removed?

@tsteur
Copy link
Member

tsteur commented Dec 6, 2016

It is never saved because there is a condition defined which is supposed to determine whether it should be activated or not. I presume this was kind of 2.X behaviour. Possibly it should kind of "clear" the query parameter value when unsetting it but don't think this is possible just yet in JS directly. Therefore we would need to unset in MeasurableSettings.php a query parameter value when "default search" is activated.
This might be possible like

$field->transform = function ($setting, $settings) {
if ($setting->getValue()) { 
    $settings->getSearchQuery...()->setValue('');
}
                return null;// never actually save a value for this
            };

I haven't tested it as I am on Piwik 2 currently but something like this could work

@mattab mattab modified the milestones: 3.0.0-rc, 3.0.1 Dec 15, 2016
@mattab mattab modified the milestones: 3.0.0-rc, 3.0.1 Dec 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants