Skip to content

Commit

Permalink
SAK-50605 Overview do not overwrite existing description with null (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ottenhoff authored Oct 23, 2024
1 parent a277ae3 commit e46000f
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -839,18 +839,23 @@ public void processActionEdit(ActionRequest request, ActionResponse response)
placement.getPlacementConfig().setProperty(HEIGHT, height);
}

String description = StringUtils.trimToNull(request.getParameter("description"));
// Need to save this processed
description = formattedText.processFormattedText(description,new StringBuilder());
// This will be null if editing a Web Content tool
// An empty string can be valid from the instructor to clear out previous value
String description = request.getParameter("description");

// update the site info
try
{
SiteService.saveSiteInfo(ToolManager.getCurrentPlacement().getContext(), description, infoUrl);
}
catch (Throwable e)
if (description != null || infoUrl != null)
{
log.warn("doConfigure_update attempting to saveSiteInfo", e);
try
{
// Need to save this processed/escaped
String processedDescription = formattedText.processFormattedText(description, new StringBuilder());
SiteService.saveSiteInfo(placement.getContext(), processedDescription, infoUrl);
}
catch (Throwable e)
{
log.warn("doConfigure_update attempting to saveSiteInfo", e);
}
}

// title
Expand Down

0 comments on commit e46000f

Please sign in to comment.