Skip to content

Commit

Permalink
Issue 51749: Site validator fails on some wikis (#6096)
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-jeckels authored Nov 26, 2024
1 parent 28714cb commit 0f4b42e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions api/src/org/labkey/api/view/Portal.java
Original file line number Diff line number Diff line change
Expand Up @@ -1712,10 +1712,9 @@ public static WebPartView getWebPartViewSafe(@NotNull WebPartFactory factory, @N
}
catch(Throwable t)
{
WebPartView errorView;
int status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
String message = "An unexpected error occurred";
errorView = ExceptionUtil.getErrorWebPartView(status, message, t, portalCtx.getRequest());
WebPartView<?> errorView = ExceptionUtil.getErrorWebPartView(status, message, t, portalCtx.getRequest());
errorView.setTitle(webPart.getName());
errorView.setWebPart(webPart);
return errorView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.labkey.api.pipeline.PipelineJob;
import org.labkey.api.pipeline.PipelineService;
import org.labkey.api.pipeline.PipelineStatusFile;
import org.labkey.api.settings.AppProps;
import org.labkey.api.util.FileUtil;
import org.labkey.api.util.StringUtilsLabKey;
import org.labkey.api.util.URLHelper;
Expand Down Expand Up @@ -60,7 +61,11 @@ public void run()
setStatus(s);
});
JspTemplate<SiteValidationForm> template = new JspTemplate<>("/org/labkey/core/admin/sitevalidation/siteValidation.jsp", _form);
ViewContext context = new ViewContext(getInfo());
// Issue 51749 - ensure we have a URL for wiki validation
ViewBackgroundInfo info = new ViewBackgroundInfo(getInfo().getContainer(),
getInfo().getUser(),
getInfo().getURL() == null ? AppProps.getInstance().getHomePageActionURL() : getInfo().getURL());
ViewContext context = new ViewContext(info);
template.setViewContext(context);
File results = FileUtil.appendName(getPipeRoot().getLogDirectory(), getResultsFileName());

Expand Down

0 comments on commit 0f4b42e

Please sign in to comment.