Skip to content

Duplicates facet does not escape its column name, resulting in an invalid GREL expression #4233

@wetneb

Description

@wetneb

The code that generates the GREL expression for the Duplicates facet does not escape the name of the selected column.
If this name contains a single quote character, this results in an invalid GREL expression, hence the facet cannot be used as such.

To Reproduce

Steps to reproduce the behavior:

  1. First, import the following CSV file:
Jane's column,Jack's column
foo,bar
hey,ho
hey,bar
  1. Then, create a Duplicates facet on any of the column (using the column menu)

Current Results

The facet's GREL expression is invalid: facetCount(value, 'value', 'Jane's column') > 1.

Expected Behavior

The GREL expression should be valid, for instance facetCount(value, 'value', 'Jane\'s column') > 1 would work.

Versions

  • Operating System: irrelevant
  • Browser Version: irrelevant
  • JRE or JDK Version: irrelevant
  • OpenRefine: master

Additional context

Brought up on our mailing list: https://groups.google.com/g/openrefine/c/2ic5F0YGcbk

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueIndicates issues suitable for newcomers to design or coding, providing a gentle introduction.Module: FrontendThese issues involve working on HTML, CSS, and JavaScript code that affects the user interface.Type: BugIssues related to software defects or unexpected behavior, which require resolution.facetsBehaviour or rendering of facets in a project

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions