Skip to content

Commit 2df31b7

Browse files
committed
If generating controller-first URLs, ignore the setting to reject them
1 parent 337c1f3 commit 2df31b7

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

api/src/org/labkey/api/view/ActionURL.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,8 @@ public ActionURL setPath(Path path)
555555
}
556556
else
557557
{
558-
if (OptionalFeatureService.get().isFeatureEnabled(AppProps.REJECT_CONTROLLER_FIRST_URLS))
558+
// Reject controller-first URLs if that experimental feature is enabled AND the generate controller-first URLs option is NOT enabled. Otherwise, admin would end up in a very bad state.
559+
if (OptionalFeatureService.get().isFeatureEnabled(AppProps.REJECT_CONTROLLER_FIRST_URLS) && !OptionalFeatureService.get().isFeatureEnabled(AppProps.GENERATE_CONTROLLER_FIRST_URLS))
559560
throw new IllegalArgumentException("Controller-first URLs are not allowed! (" + savedPath +")");
560561
setIsCanonical(!useContainerRelativeURL());
561562
}

core/src/org/labkey/core/CoreModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,12 +550,12 @@ public QuerySchema createSchema(DefaultSchema schema, Module module)
550550
));
551551
OptionalFeatureService.get().addFeatureFlag(new OptionalFeatureFlag(AppProps.GENERATE_CONTROLLER_FIRST_URLS,
552552
"Restore controller-first URLS",
553-
"Generate URLs in a legacy format the puts the controller before the folder path. This option will be removed in LabKey Server 26.3.",
553+
"Generate URLs in a legacy format that puts the controller name before the folder path. This option will be removed in LabKey Server 26.3.",
554554
false, false, OptionalFeatureService.FeatureType.Deprecated
555555
));
556556
OptionalFeatureService.get().addExperimentalFeatureFlag(AppProps.REJECT_CONTROLLER_FIRST_URLS,
557557
"Reject controller-first URLs",
558-
"Require standard path-first URLs.",
558+
"Require standard path-first URLs. Note: This option will be ignored if the deprecated feature for generating controller-first URLs is enabled.",
559559
false
560560
);
561561

0 commit comments

Comments
 (0)