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

Store site search settings correctly #11022

Merged
merged 5 commits into from Dec 16, 2016
Merged

Store site search settings correctly #11022

merged 5 commits into from Dec 16, 2016

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Dec 15, 2016

fixes #10971

@sgiehl sgiehl added Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Dec 15, 2016
@@ -226,7 +226,7 @@ public function setValue($value)
$value = call_user_func($config->transform, $value, $this);
}

if (isset($this->type)) {
if (isset($this->type) && !is_null($value)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is needed as otherwise null values would be casted to 0 or empty string

return null;// never actually save a value for this
$field->transform = function ($value) use ($settings) {
if ($value) {
$settings->unsetSiteSearchKeywords = true;
Copy link
Member Author

Choose a reason for hiding this comment

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

Needed to do that using a class property, as setting a value for the other setting would be directly overwritten afterwards.

@mattab
Copy link
Member

mattab commented Dec 15, 2016

Seems not working for me. reproduce:

  • Add a new website, by default the checkbox is checked. Save.
  • Edit the website:
    • Expected: checkbox is checked
    • Got: checkbox not checked.

@sgiehl
Copy link
Member Author

sgiehl commented Dec 15, 2016

Hope that works now as expected. Please check again

@mattab mattab added this to the 3.0.0-rc milestone Dec 16, 2016
@mattab mattab merged commit a2c17ae into 3.x-dev Dec 16, 2016
@mattab mattab deleted the fixsitesearchsetting branch December 16, 2016 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Website>Manager "Use Global site search parameters" does not get saved
2 participants