Skip to content

Commit 45af07b

Browse files
committed
COLDBOX-1330 #resolve
missing replacement of double // on layouts/views on new rendering schemas
1 parent 5b01fa9 commit 45af07b

1 file changed

Lines changed: 26 additions & 7 deletions

File tree

system/web/Renderer.cfc

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ component
653653

654654
// Try to locate the view
655655
for ( var thisLayoutPath in layoutPaths ) {
656-
reReplace( thisLayoutPath, "//", "/", "all" );
656+
thisLayoutPath = reReplace( thisLayoutPath, "//", "/", "all" );
657657
if ( fileExists( expandPath( thisLayoutPath & ".cfm" ) ) ) {
658658
return thisLayoutPath & ".cfm";
659659
}
@@ -701,11 +701,20 @@ component
701701

702702
// Declare Locations
703703
var moduleName = event.getCurrentModule();
704-
var parentModuleLayoutPath = "/#variables.appMapping#/#variables.layoutsConvention#/modules/#moduleName#/#arguments.layout#";
705-
var parentCommonLayoutPath = "/#variables.appMapping#/#variables.layoutsConvention#/modules/#arguments.layout#";
704+
var parentModuleLayoutPath = reReplace(
705+
"/#variables.appMapping#/#variables.layoutsConvention#/modules/#moduleName#/#arguments.layout#",
706+
"//",
707+
"/",
708+
"all"
709+
);
710+
var parentCommonLayoutPath = reReplace(
711+
"/#variables.appMapping#/#variables.layoutsConvention#/modules/#arguments.layout#",
712+
"//",
713+
"/",
714+
"all"
715+
);
706716
var moduleLayoutPath = "#variables.modulesConfig[ moduleName ].mapping#/#variables.modulesConfig[ moduleName ].conventions.layoutsLocation#/#arguments.layout#";
707717

708-
709718
// Check parent view order setup
710719
if ( variables.modulesConfig[ moduleName ].layoutParentLookup ) {
711720
// We check if layout is overridden in parent first.
@@ -782,7 +791,7 @@ component
782791

783792
// Try to locate the view
784793
for ( var thisViewPath in viewPaths ) {
785-
reReplace( thisViewPath, "//", "/", "all" );
794+
thisViewPath = reReplace( thisViewPath, "//", "/", "all" );
786795
if ( fileExists( expandPath( thisViewPath & ".cfm" ) ) ) {
787796
return thisViewPath & ".cfm";
788797
}
@@ -828,8 +837,18 @@ component
828837

829838
// Declare Locations
830839
var moduleName = arguments.module;
831-
var parentModuleViewPath = "/#variables.appMapping#/#variables.viewsConvention#/modules/#moduleName#/#arguments.view#";
832-
var parentCommonViewPath = "/#variables.appMapping#/#variables.viewsConvention#/modules/#arguments.view#";
840+
var parentModuleViewPath = reReplace(
841+
"/#variables.appMapping#/#variables.viewsConvention#/modules/#moduleName#/#arguments.view#",
842+
"//",
843+
"/",
844+
"all"
845+
);
846+
var parentCommonViewPath = reReplace(
847+
"/#variables.appMapping#/#variables.viewsConvention#/modules/#arguments.view#",
848+
"//",
849+
"/",
850+
"all"
851+
);
833852
var moduleViewPath = "#variables.modulesConfig[ moduleName ].mapping#/#variables.modulesConfig[ moduleName ].conventions.viewsLocation#/#arguments.view#";
834853

835854
// Check parent view order setup

0 commit comments

Comments
 (0)