Skip to content

Preserve query parameters in form options sources - #1356

Merged
lovasoa merged 1 commit into
mainfrom
fix-options_source-concatenation-issue
Jul 29, 2026
Merged

Preserve query parameters in form options sources#1356
lovasoa merged 1 commit into
mainfrom
fix-options_source-concatenation-issue

Conversation

@lovasoa

@lovasoa lovasoa commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Motivation

  • The existing options loader built the remote options URL by string-concatenation and appended ?search=..., which dropped or corrupted any existing query parameters in options_source URLs.
  • This broke use-cases where options_source already contained parameters (for example ...?id=... or ?category=...) and required a robust way to add/replace the search parameter.

Description

  • In sqlpage/tomselect.js replaced string concatenation with the browser URL API and URLSearchParams to build the request URL: new URL(options_source, document.baseURI) and options_url.searchParams.set("search", query) before calling fetch.
  • Updated the end-to-end test tests/end-to-end/official-site.spec.ts to exercise and assert that existing query parameters are preserved when remote searches run.
  • Documented the behavior and example options_source with an existing query parameter in examples/official-site/sqlpage/migrations/01_documentation.sql.
  • Added a brief CHANGELOG.md entry describing the fix.

Testing

  • Ran npm run format which completed successfully.
  • Ran npm test (the repository biome check step) which completed successfully but reported lint diagnostics/warnings (no test failures).
  • Ran git diff --check which reported no issues after the changes.

Codex Task

@lovasoa
lovasoa merged commit a065bb8 into main Jul 29, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant