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

Improve type checks in SitesManager API #22704

Open
wants to merge 4 commits into
base: 5.x-dev
Choose a base branch
from
Open

Improve type checks in SitesManager API #22704

wants to merge 4 commits into from

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Oct 22, 2024

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

@sgiehl sgiehl added the Needs Review PRs that need a code review label Oct 22, 2024
@sgiehl sgiehl added this to the 5.2.0 milestone Oct 22, 2024
@sgiehl sgiehl requested a review from a team October 22, 2024 13:14
@sgiehl sgiehl force-pushed the typecheck branch 2 times, most recently from 6359ebe to acd442a Compare October 22, 2024 14:38
@sgiehl sgiehl removed the request for review from a team October 22, 2024 15:19
@sgiehl sgiehl removed the Needs Review PRs that need a code review label Oct 22, 2024
@sgiehl sgiehl force-pushed the typecheck branch 2 times, most recently from 456d6e6 to 1ea6d47 Compare October 23, 2024 07:09
@sgiehl sgiehl requested a review from a team October 24, 2024 09:55
@sgiehl sgiehl added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Oct 24, 2024
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.

2 participants