@mattab opened this issue on December 6th 2016

As reported in https://github.com/piwik/piwik/issues/10412#issuecomment-262844709

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).

@sgiehl commented on December 6th 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 commented on December 6th 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

This issue was closed on December 16th 2016
Powered by GitHub Issue Mirror