Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
While working on another issue I came across the fact, that the SitesManager API currently does not check the type that is provided when creating or updating a measurable.
This makes it possible to create measurables with an invalid type, or update an existing measurable with one.
This PR therefor introduces a check if the provided type exists.
When updating an existing site, the type will only be checked if it differs from the previous one.
This is done, to ensure that a measurable that already has an invalid type (e.g. due to a removed plugin), is still update-able.
[ ] Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
[ ] Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
Description:
While working on another issue I came across the fact, that the SitesManager API currently does not check the type that is provided when creating or updating a measurable.
This makes it possible to create measurables with an invalid type, or update an existing measurable with one.
This PR therefor introduces a check if the provided type exists. When updating an existing site, the type will only be checked if it differs from the previous one. This is done, to ensure that a measurable that already has an invalid type (e.g. due to a removed plugin), is still update-able.
Review