diff --git a/query/src/org/labkey/query/controllers/QueryController.java b/query/src/org/labkey/query/controllers/QueryController.java index 35ba9a5d411..0ed4aa66be9 100644 --- a/query/src/org/labkey/query/controllers/QueryController.java +++ b/query/src/org/labkey/query/controllers/QueryController.java @@ -714,7 +714,8 @@ public DataSourceAdminAction(ViewContext viewContext) public ModelAndView getView(Object o, BindException errors) { // Site Admin or Troubleshooter? Troubleshooters can see all the information but can't test data sources. - boolean hasAdminOpsPerms = getContainer().hasPermission(getUser(), AdminOperationsPermission.class); + // Dev mode only, since "Test" is meant for LabKey's own development and testing purposes. + boolean showTestButton = getContainer().hasPermission(getUser(), AdminOperationsPermission.class) && AppProps.getInstance().isDevMode(); List allDefs = QueryManager.get().getExternalSchemaDefs(null); MultiValuedMap byDataSourceName = new ArrayListValuedHashMap<>(); @@ -729,7 +730,7 @@ public ModelAndView getView(Object o, BindException errors) BR(), TABLE(cl("labkey-data-region"), TR(cl("labkey-show-borders"), - hasAdminOpsPerms ? TD(cl("labkey-column-header"), "Test") : null, + showTestButton ? TD(cl("labkey-column-header"), "Test") : null, TD(cl("labkey-column-header"), "Data Source"), TD(cl("labkey-column-header"), "Current Status"), TD(cl("labkey-column-header"), "URL"), @@ -759,7 +760,7 @@ public ModelAndView getView(Object o, BindException errors) return Stream.of( TR( cl(rowStyle), - hasAdminOpsPerms ? TD(connected ? new ButtonBuilder("Test").href(new ActionURL(TestDataSourceConfirmAction.class, getContainer()).addParameter("dataSource", scope.getDataSourceName())) : "") : null, + showTestButton ? TD(connected ? new ButtonBuilder("Test").href(new ActionURL(TestDataSourceConfirmAction.class, getContainer()).addParameter("dataSource", scope.getDataSourceName())) : "") : null, TD(HtmlString.NBSP, scope.getDisplayName()), TD(status), TD(scope.getDatabaseUrl()), diff --git a/wiki/src/org/labkey/wiki/WikiController.java b/wiki/src/org/labkey/wiki/WikiController.java index a26266905d8..a9c9c35cc7a 100644 --- a/wiki/src/org/labkey/wiki/WikiController.java +++ b/wiki/src/org/labkey/wiki/WikiController.java @@ -427,7 +427,7 @@ public ActionURL getCancelUrl() @Override public ActionURL getFailURL(WikiNameForm wikiNameForm, BindException errors) { - return new ManageAction(getViewContext(), _wiki).getUrl(); + return _wiki != null ? new ManageAction(getViewContext(), _wiki).getUrl() : null; } }