The PrintListener for CategoryTemplates select box did not clear the options of the select box. The result was that the list of options in the box became longer which each request. Additionally this caused a massive amount of cpu load and memory consumption (resulting in an out of memory error) when the category form was requested multiple time, for example when creating some categories.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2835 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-09-04 09:18:47 +00:00
parent b7ba322576
commit 31d94afaad
1 changed files with 6 additions and 4 deletions

View File

@ -354,13 +354,15 @@ public class CategoryTemplates extends CMSContainer {
m_type = new SingleSelect(type.getStateParameter());
try {
m_type.addPrintListener(new PrintListener() {
public void prepare(PrintEvent e) {
PageState state = e.getPageState();
@Override
public void prepare(PrintEvent event) {
PageState state = event.getPageState();
ContentSection section = ContentSectionServlet
.getContentSection(state
.getRequest());
SingleSelect target = (SingleSelect)e.getTarget();
SingleSelect target = (SingleSelect)event.getTarget();
target.clearOptions();
ContentTypeCollection types = section.getContentTypes();
types.addOrder(ContentType.LABEL);