Repository navigation
Fix rendering outside a web request in non TEST env (#60) - #61
Conversation
|
Minor suggestion on Suggestion: make |
|
@sbglasius Thanks for the review. Went with moving |
|
@billgonemad Thank you for your contribution. The release is running and the artifact should be available as version 7.0.2 in the next hour or so. |
Fixes #60
Problem
Since 364bd4e,
RenderEnvironmentonly bound a web request in the TEST environment. In production/development, rendering off-request (jobs, async tasks, BootStrap) NPE'd as soon as a template used a taglib.Fix
GrailsWebRequestover Grails' servlet-freePageRendererstubs (the same onesgroovyPageRendereruses). It uses the real context path and runs request-scoped cleanup.session,flash,paramsand request attributes keep working. Onlyout, the locale resolver andWrappedResponseHolderare swapped, and they are restored afterwards.Behaviour change
Off-request,
session,withoutgrails.serverURLthrowUnsupportedOperationExceptionin all environments. They already NPE'd in production on 7.0.x, but in TEST they used to work, so downstream test suites may notice. Setgrails.serverURL`.Testing
New integration specs force
grails.env=production, since TEST hid the bug. 14 of the 18 new tests fail against 7.0.x../gradlew check build docs :example:integrationTest: 90 tests, 0 failures.