Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Subsystem layouts forget own location when the main error view is rendered #456
FW/1 3.5 using subsystems 2.0
When generating links in a subsystem layout the buildUrl function call buildurl("section.item") will normally correctly generate the link "index.cfm?action=subsystem:section.item".
However if an error occurs the buildurl function defaults to the subsystem of the error template, i.e. the link generated is "index.cfm?action=section.item".
Sorry Sean been otherwise occupied. I narrowed the cause of the error further. If you only have a default layout file in your subsystem then the error will be rendered in the main apps error viewfile without first rendering the subsystems layout.
If however you specify a different layout in your subsystem controller then that subsystem layout will be rendered with the error contents within it, however any navigation links in that layout will be made relative to the main application and not the subsystem as before.
I am including a test application that should demonstrate the error in the subsystems layout nav when you enter the test:main.breakit action.
This is a somewhat subtle issue and is not actually related to error handling, per se, as far as I can tell.
When you set a layout, even if the layout is part of a subsystem, the layout will be evaluated in the context of the current request's subsystem. You can see this, for example, if you call
When an error is raised, the request will execute in the context of the error handler request.
What should probably happen here is for the
I just tested, and having the
That leaves the question of whether layouts should be evaluated in the context of their own subsystem or the current request's subsystem (as happens now). I can see arguments for both but changing to the former could be a breaking change for some folks and I suspect deliberately setting a layout to pick up another subsystem's files is very much "caveat programmer".