From d4d32e123947ba7dfa9c511179b8fe5bb6c54c52 Mon Sep 17 00:00:00 2001 From: Gunnar Date: Sun, 3 May 2026 23:00:36 +0200 Subject: [PATCH] Renderer.renderLayout throws "LayoutNotFoundException" when called with an empty layout (regression vs 7.x) Any caller that produces an empty cbox_currentLayout (e.g. event.setLayout("") for JSON endpoints, AJAX handlers, or nolayout-style flows) crashes during render with: The layout [] was not found in the module path: //layouts/ --- system/web/Renderer.cfc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/system/web/Renderer.cfc b/system/web/Renderer.cfc index ec6aac0fd..5715a0eb1 100755 --- a/system/web/Renderer.cfc +++ b/system/web/Renderer.cfc @@ -605,20 +605,20 @@ component } } - // Discover the layout location + helpers - var layoutLocations = discoverViewPaths( - view : cbox_currentLayout, - module : arguments.module, - explicitModule: cbox_explicitModule, - isLayout : true - ); + // Layout location holder — only populated when layout is non-empty. + // discoverViewPaths throws on an empty layout name (regression vs ColdBox 7). + var layoutLocations = { viewPath : "", viewHelperPath : [] }; - // If Layout is blank, then just delegate to the view - // No layout rendering. + // If Layout is blank, then just delegate to the view (no layout rendering). if ( len( cbox_currentLayout ) eq 0 ) { iData.renderedLayout = this.view(); } else { - // Render the layout with it's helpers + layoutLocations = discoverViewPaths( + view : cbox_currentLayout, + module : arguments.module, + explicitModule: cbox_explicitModule, + isLayout : true + ); iData.renderedLayout = renderViewComposite( view : cbox_currentLayout, viewPath : layoutLocations.viewPath,