Skip to content

Segment with 'Does not contain' operand is invalid if comma is in value #19617

@samjf

Description

@samjf

When creating a new segment with a 'Does not contain' operator, if your value contains a comma then when an archive is run it will return "The segment condition ' After comma' is not valid."

Expected Behavior

Commas should be allowed as a valid character in the filter value

Current Behavior

A segment condition is not valid error message is display.

Possible Solution

I believe because it can be saved as a segment, but only fails on testing that the issue is not in the initial validation.
A big of debugging showed that getCleanedExpression function might be near the fault. This is likely caused by URL decoding done before parsing the definition or something.

Steps to Reproduce (for Bugs)

image
image

  1. Create a new segment in the drop down
  2. Choose the following options LHS: Event Name, middle: 'Does not contain', RHS: 'Before comma, after comma'
  3. Press the 'Test' button

The following is my segment definition from my DB: eventName!@Before%253A%2520comma%252C%2520After%2520comma

Context

This has blocked an instance from finishing archiving.

The error itself will not occur when you save the Segment, but only when it is tested in the segment form or run during the archive.

Your Environment

  • Matomo Version: 4.10.1
  • PHP Version: 8.0
  • Server Operating System: Linux / Mac
  • Additionally installed plugins:
  • Browser: Firefox
  • Operating System:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugFor errors / faults / flaws / inconsistencies etc.MajorIndicates the severity or impact or benefit of an issue is much higher than normal but not critical.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions