Open ilopmar opened 8 years ago
Possibly relates to #10047
The root cause of this issue is because the cache plugin also defines a grails-app/views/layouts/main.gsp
layout. If you were to rename the layout to something else it starts working.
At the moment we have no mechanism to specify a specific plugin layout to apply so layouts have to have unique names.
Another option is to use loadBefore
/ loadAfter
to ensure the plugin loads earlier than cache.
Using def loadAfter = ['cache']
as you suggested did the trick. Thanks!
I have a Grails 3.1.10 plugin and application in a gradle multi-project with the following setup:
Expected Behaviour
The expected behaviour is that the layout from the plugin is applied. This works in Grails 2.3.6.
Actual Behaviour
The layout is not applied although the view is rendered correctly (but without the layout)
Environment Information
grails run-app
Example Application
I've created a sample app that reproduces the problem: https://github.com/ilopmar/grails3-layout-and-view-plugin.
After cloning the repo:
And then open the browser and go to
http://localhost:8080/foo/index
You will see the content of the plugin view but without the layout applied.
If now (without stopping the application) move the file
myplugin/grails-app/views/layouts/main.gsp
to myapp/grails-app/views/layouts/main.gsp` and reload the page, the layout is applied.