Skip to content

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

Merged
labkey-adam merged 6 commits into
developfrom
fb_viewcontext_get_string
Oct 1, 2026
Merged

labkey-adam merged 6 commits into
developfrom
fb_viewcontext_get_string

Conversation

@labkey-adam

@labkey-adam labkey-adam commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Rationale

Stop repeated URL parameters from causing unhandled ClassCastExceptions (GH Issue 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 changed the title ViewContext.getString() GH Issue 1631: ViewContext.getString() Sep 30, 2026
@labkey-adam labkey-adam self-assigned this Oct 1, 2026
@labkey-adam
labkey-adam merged commit ed2e86d into develop Oct 1, 2026
9 checks passed
@labkey-adam
labkey-adam deleted the fb_viewcontext_get_string branch October 1, 2026 17:38
labkey-adam added a commit that referenced this pull request Oct 2, 2026
labkey-adam added a commit to LabKey/commonAssays that referenced this pull request Oct 5, 2026
## Rationale
`ViewContext.getString()` is safer than blindly casting

## Related Pull Requests
- LabKey/platform#8118
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