diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2016-12-12 13:23:02 +0300 |
---|---|---|
committer | Matthieu Aubry <mattab@users.noreply.github.com> | 2016-12-12 13:23:02 +0300 |
commit | bfb0393b4316cb0b7270636565dace422372aa97 (patch) | |
tree | bd5456a4200e1b1b508963464bc063f0d2e9b126 /core | |
parent | e8ca3f756842d368cd94f3f4dcd288d6ccffc8d3 (diff) |
Fix website measurable type was defining settings and properties for all types (#10991)
* Fix website measurable type was defining settings and properties for all types
The settings specified in website measurable type should not apply to any other type by default.
* add possibility to extend website settings
* fix comparison was wrong
* fix comparison was wrong
* trying to fix the tests
* fix test
* tweak code
* add test to make sure validation works with any type
* add possibility to update group via settings
Diffstat (limited to 'core')
-rw-r--r-- | core/Measurable/Type/TypeManager.php | 11 | ||||
-rw-r--r-- | core/Settings/Measurable/MeasurableProperty.php | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/core/Measurable/Type/TypeManager.php b/core/Measurable/Type/TypeManager.php index a514abbbdc..8a886d29d5 100644 --- a/core/Measurable/Type/TypeManager.php +++ b/core/Measurable/Type/TypeManager.php @@ -29,6 +29,17 @@ class TypeManager return $instances; } + public function isExistingType($typeId) + { + foreach ($this->getAllTypes() as $type) { + if ($type->getId() === $typeId) { + return true; + } + } + + return false; + } + /** * @param string $typeId * @return Type|null diff --git a/core/Settings/Measurable/MeasurableProperty.php b/core/Settings/Measurable/MeasurableProperty.php index b49ee04698..ebf03635ca 100644 --- a/core/Settings/Measurable/MeasurableProperty.php +++ b/core/Settings/Measurable/MeasurableProperty.php @@ -34,7 +34,7 @@ class MeasurableProperty extends \Piwik\Settings\Setting 'ecommerce', 'sitesearch', 'sitesearch_keyword_parameters', 'sitesearch_category_parameters', 'exclude_unknown_urls', 'excluded_ips', 'excluded_parameters', - 'excluded_user_agents', 'keep_url_fragment', 'urls' + 'excluded_user_agents', 'keep_url_fragment', 'urls', 'group' ); /** |