Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions system/web/Renderer.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -605,19 +605,23 @@ component
}
}

// Discover the layout location + helpers
var layoutLocations = discoverViewPaths(
view : cbox_currentLayout,
module : arguments.module,
explicitModule: cbox_explicitModule,
isLayout : true
);

// If Layout is blank, then just delegate to the view
// No layout rendering.
if ( len( cbox_currentLayout ) eq 0 ) {
iData.renderedLayout = this.view();
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change fixes a regression around event.noLayout() + module layoutParentLookup, but there’s no accompanying regression test. The repo already has renderer specs (e.g. tests/specs/web/RendererTest.cfc), so it would be good to add a test that executes a module request with layoutParentLookup=true that calls event.noLayout() and asserts rendering succeeds (and does not attempt layout discovery).

Suggested change
iData.renderedLayout = this.view();
var viewLocations = discoverViewPaths(
view : event.getCurrentView(),
module : arguments.module,
explicitModule: cbox_explicitModule
);
iData.renderedLayout = renderViewComposite(
view : event.getCurrentView(),
viewPath : viewLocations.viewPath,
viewHelperPath: viewLocations.viewHelperPath,
args : args,
viewVariables : arguments.viewVariables
);

Copilot uses AI. Check for mistakes.
// Announce
if ( not arguments.prePostExempt ) {
announce( "postLayoutRender", iData );
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postLayoutRender is now announced with different data depending on whether a layout was rendered. In the blank-layout branch the announced payload omits viewPath, while the non-blank branch appends it. Since postLayoutRender previously always included viewPath, interceptors that assume this key exists may now error when event.noLayout() is used. Consider always including a viewPath key (e.g., empty string/null) for consistency/backwards compatibility.

Suggested change
announce( "postLayoutRender", iData );
announce( "postLayoutRender", iData.append( { viewPath : "" } ) );

Copilot uses AI. Check for mistakes.
}
} else {
// Discover the layout location + helpers
var layoutLocations = discoverViewPaths(
view : cbox_currentLayout,
module : arguments.module,
explicitModule: cbox_explicitModule,
isLayout : true
);

// Render the layout with it's helpers
iData.renderedLayout = renderViewComposite(
view : cbox_currentLayout,
Expand All @@ -626,11 +630,11 @@ component
args : args,
viewVariables : arguments.viewVariables
);
}

// Announce
if ( not arguments.prePostExempt ) {
announce( "postLayoutRender", iData.append( { viewPath : layoutLocations.viewPath } ) );
// Announce
if ( not arguments.prePostExempt ) {
announce( "postLayoutRender", iData.append( { viewPath : layoutLocations.viewPath } ) );
}
}

return iData.renderedLayout;
Expand Down