Grails

Regression: Error pages require layout with same name as controller

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 0.5
  • Fix Version/s: 0.5.5-RC1
  • Component/s: None
  • Labels:
    None

Description

If you get an error rendering a view (say a problem in a taglib) the error page will fail to render if you do not have a layout with the same name as the controller that was rendering the view.

Issue Links

Activity

Hide
Lee Butts added a comment -

Spoke to Mark about reproducing this and he advised that it's a dupe of GRAILS-603.

Show
Lee Butts added a comment - Spoke to Mark about reproducing this and he advised that it's a dupe of GRAILS-603.
Hide
Marc Palmer added a comment -

Actually I have confirmed this is not a duplicate, it is a different problem

Show
Marc Palmer added a comment - Actually I have confirmed this is not a duplicate, it is a different problem
Hide
Marc Palmer added a comment -

Screenshot of a page where an error occures in the controller. The page is laid out with the "competition" layout, and you can see inline that error.gsp is attempting to render AGAIN with competition layout, which causes an NPE during the rendering of error.gsp as the competition layout requires some data that error.gsp does not supply.

If you edit error.gsp to explicitly set a layout like "main" the error page renders correctly.

Ergo, in some situations in 0.5 error.gsp is being rendered with the current controller's layout (by convention) instead of no layout at all (when none is specified in error.gsp)

Show
Marc Palmer added a comment - Screenshot of a page where an error occures in the controller. The page is laid out with the "competition" layout, and you can see inline that error.gsp is attempting to render AGAIN with competition layout, which causes an NPE during the rendering of error.gsp as the competition layout requires some data that error.gsp does not supply. If you edit error.gsp to explicitly set a layout like "main" the error page renders correctly. Ergo, in some situations in 0.5 error.gsp is being rendered with the current controller's layout (by convention) instead of no layout at all (when none is specified in error.gsp)
Hide
Marc Palmer added a comment -

The fact that the (incorrectly rendered) error output is included mid-page here is a manifestation of GRAILS-603 but as above this is not the whole problem.

Show
Marc Palmer added a comment - The fact that the (incorrectly rendered) error output is included mid-page here is a manifestation of GRAILS-603 but as above this is not the whole problem.
Hide
Graeme Rocher added a comment -

Surely the fix then is to set the layout of error.gsp to main? Or am I missing something?

Show
Graeme Rocher added a comment - Surely the fix then is to set the layout of error.gsp to main? Or am I missing something?
Hide
Lee Butts added a comment -

Hi Marc,

should be ok now,

cheers

Lee

Show
Lee Butts added a comment - Hi Marc, should be ok now, cheers Lee
Hide
Graeme Rocher added a comment -

Bulk closing bunch of resolved issues

Show
Graeme Rocher added a comment - Bulk closing bunch of resolved issues

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: