Skip to content

Commit

Permalink
SAK-12241 Editing section name doesn't update section description
Browse files Browse the repository at this point in the history
git-svn-id: https://source.sakaiproject.org/svn/sections/trunk@53354 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
smarquard committed Oct 11, 2008
1 parent ece2da2 commit 1966b95
Showing 1 changed file with 23 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1271,24 +1271,31 @@ public void updateSection(String sectionUuid, String title, Integer maxEnrollmen
// Disallow if we're in an externally managed site
ensureInternallyManaged(section.getCourse().getUuid());

// Set the decorator's fields
section.setTitle(title);
section.setMaxEnrollments(maxEnrollments);
section.setMeetings(filterMeetings(meetings));

// Decorate the framework section
Group group = findGroup(sectionUuid);
section.decorateGroup(group);

// Save the site with its new section
try {
siteService().save(group.getContainingSite());
clearSite(group.getContainingSite().getId());
postEvent("section.update", sectionUuid);
} catch (IdUnusedException ide) {
log.error("Error saving site... could not find site for section " + group, ide);
} catch (PermissionException pe) {
log.error("Error saving site... permission denied for section " + group, pe);
Site site = group.getContainingSite();

if (site != null && group != null) {
// Set the decorator's fields
section.setTitle(title);
section.setDescription(site.getTitle() + ", " + title);
section.setMaxEnrollments(maxEnrollments);
section.setMeetings(filterMeetings(meetings));

section.decorateGroup(group);

// Save the site with its new section
try {
siteService().save(site);
clearSite(site.getId());
postEvent("section.update", sectionUuid);
} catch (IdUnusedException ide) {
log.error("Error saving site... could not find site for section " + group, ide);
} catch (PermissionException pe) {
log.error("Error saving site... permission denied for section " + group, pe);
}
} else {
log.error("Error updating section: could not find site or group for section " + sectionUuid);
}
}

Expand Down

0 comments on commit 1966b95

Please sign in to comment.