Skip to content

GH Issue 1631: ViewContext.getString() (#8118) - #8124

Merged
labkey-adam merged 1 commit into
release26.10-SNAPSHOTfrom
26.10_fb_viewcontext_get_string
Oct 2, 2026
Merged

labkey-adam merged 1 commit into
release26.10-SNAPSHOTfrom
26.10_fb_viewcontext_get_string

Conversation

@labkey-adam

Copy link
Copy Markdown
Contributor

Rationale

Backport to 26.10

## Rationale
Stop repeated URL parameters from causing unhandled ClassCastExceptions
([GH Issue
1631](LabKey/internal-issues#1631)).

## Changes
- Introduce `ViewContext.getString()` which checks the value type before
returning it. It returns `null` or a `String`, or else it throws a clear
`BadRequestException`, which avoids logging and mothership reporting.
- Use this safer method in `StudyController`, `ReportsController`,
`AnnouncementsController`, etc.
- Simple unit test for getString()
- Introduce `ViewContext.get(String)` and deprecate
`ViewContext.get(Object)`
@labkey-adam
labkey-adam merged commit d4b28eb into release26.10-SNAPSHOT Oct 2, 2026
11 checks passed
@labkey-adam
labkey-adam deleted the 26.10_fb_viewcontext_get_string branch October 2, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants