-
-
Notifications
You must be signed in to change notification settings - Fork 968
Closed
Milestone
Description
Task List
- Steps to reproduce provided
- Example that reproduces the problem attached
- Full description of the issue provided (see below)
This may be somewhat related to #10047:
Having two plugins that provide the same template (same name, same path). First called template is cached and it's not possible anymore to access the template from the second plugin.
<g:render template="theTemplate" plugin="pluginA" />
<g:render template="theTemplate" plugin="pluginB" />
Expected Behaviour
Content of pluginA's template followed by content of pluginB's template
Actual Behaviour
Twice pluginA's content.
I was able to track this down to org.grails.web.gsp.GroovyPagesTemplateRenderer, method
private Template findAndCacheTemplate(Object, TemplateVariableBinding, String, String, String, final String)
scriptSource = groovyPageLocator.findTemplateInBinding(controller, pluginName, templatePath, pageScope);
...
if (scriptSource == null) {
cacheKey = contextPath + pluginName + uri;
} else {
cacheKey = scriptSource.getURI();
}
Actually, scriptSource is not null (since fix for #10047?) and going into the else-branch (omitting pluginName) is wrong.
Steps to Reproduce/Example Application
- git clone https://github.com/pereiss/templatebug.git
- cd templatebug/myapp
- grails run-app
- call http://localhost:8080
Environment Information
- Operating System: Ubuntu Linux 16.04
- Grails Version: 3.1.11+, 3.2+
- JDK Version: jdk8
Metadata
Metadata
Assignees
Labels
No labels