Skip to content

Commit

Permalink
SAK-44770 lessons > page settings does not reflect custom tool title …
Browse files Browse the repository at this point in the history
…from ToolConfiguration (sakaiproject#8888)
  • Loading branch information
bjones86 authored Dec 10, 2020
1 parent d740b09 commit 85a13ae
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4957,7 +4957,15 @@ private void createEditTitleDialog(UIContainer tofill, SimplePage page, SimplePa
makeCsrf(form, "csrf14");

UIOutput.make(form, "pageTitleLabel", messageLocator.getMessage("simplepage.pageTitle_label"));
UIInput.make(form, "pageTitle", "#{simplePageBean.pageTitle}");

String internalPageTitle = page.getTitle();
String externalPageTitle = simplePageBean.getCurrentSite().getPage(page.getToolId()).getTools().stream()
.filter(t -> t.getId().equals(toolManager.getCurrentPlacement().getId()))
.findFirst()
.map(t -> t.getTitle())
.orElse("");
String effectivePageTitle = (StringUtils.isNotBlank(externalPageTitle) && !externalPageTitle.equals(internalPageTitle)) ? externalPageTitle : internalPageTitle;
UIInput.make(form, "pageTitle", "#{simplePageBean.pageTitle}", effectivePageTitle);

if (!simplePageBean.isStudentPage(page)) {
UIOutput.make(tofill, "hideContainer");
Expand Down

0 comments on commit 85a13ae

Please sign in to comment.