From 31d94afaadba0951a5815550746ed35435cffd7d Mon Sep 17 00:00:00 2001 From: jensp Date: Thu, 4 Sep 2014 09:18:47 +0000 Subject: [PATCH] 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 --- .../arsdigita/cms/ui/templates/CategoryTemplates.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ccm-cms/src/com/arsdigita/cms/ui/templates/CategoryTemplates.java b/ccm-cms/src/com/arsdigita/cms/ui/templates/CategoryTemplates.java index eaf788967..4863c1b42 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/templates/CategoryTemplates.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/templates/CategoryTemplates.java @@ -354,14 +354,16 @@ 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);