Skip to content

Multi-select license/modality drops all but the first (form repeated params) #98

Closed

Description

@neuromechanist

Problem

Selecting two license chips (e.g. Share-alike + Non-commercial) only applies the first — the result "resets to share-alike". The same flaw affects multi-modality selection.

Root cause

The filter sidebar is a native GET form. A checkbox group with name="license" submits repeated params:

?license=sharealike&license=noncommercial

But filterStateFromURL reads only the first value:

s.licenseTiers = parseLicenseTiers(params.get("license")); // .get() = first only
s.modalities  = parseModalities(params.get("modality"));   // same bug

Confirmed live:

  • ?license=sharealike&license=noncommercial (form) → "16 datasets", only share-alike chip selected ❌
  • ?license=sharealike,noncommercial (our pagination/tag links, comma-joined) → "24 datasets", both selected ✅

The server already does OR correctly; the frontend drops the second value on form submit. (Note: tiers are mutually-exclusive buckets per dataset — a CC-BY-NC-SA row buckets as Non-commercial — so multi-select with OR is exactly how a user reaches overlapping licenses.)

Fix

Parse with params.getAll() and flatten comma-splits, so both the repeated (form) and comma-joined (link) forms work for license and modality. Keeps the chips as real multi-select toggles; no UI change required.

Acceptance

  • /discover?license=sharealike&license=noncommercial → OR union (~24), both chips selected.
  • /discover?modality=EEG&modality=MEG → multi-modality applies.
  • Comma-joined URLs still work (pagination, tag links).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions