Skip to content

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Apr 2, 2024

Description:

When the "test segment" feature is used, when adding a new segment an error might be thrown when clicking on save, after the visitors log popover has been closed.

This happened due to the fact, that opening a popover manipulates the url hash. As the segment editor was watching the whole url, instead of only the relevant segment part, it was resetting the current segment definition to the one from url hash.
Only watching the segment part, fixes this problem, and the segment is stored correctly again.

In addition this PR fixes an error that occurred, when the "add condition" link was clicked to fast, after the segment editor was opened.

fixes #22028

Review

@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. 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 Apr 2, 2024
@sgiehl sgiehl added this to the 5.1.0 milestone Apr 2, 2024
@sgiehl sgiehl requested a review from a team April 2, 2024 09:31
@michalkleiner
Copy link
Contributor

I wasn't able to replicate the failure locally before applying the fix here, are there any specific steps to take?

What I've tried:

  1. create new segment (give it a name, select one condition)
  2. test the segment (modal opens up with visits)
  3. close the test modal
  4. Save segment (works ok with/without the fix)

Copy link
Contributor

This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers

@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Apr 12, 2024
@sgiehl sgiehl merged commit ac90a02 into 5.x-dev Apr 12, 2024
@sgiehl sgiehl deleted the dev-17886 branch April 12, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. 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. Stale The label used by the Close Stale Issues action
Development

Successfully merging this pull request may close these issues.

Segment-Creation with "Please specify a value for 'definition'." error
2 participants