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-94f89814c4dfmaster
parent
b7ba322576
commit
31d94afaad
|
|
@ -354,14 +354,16 @@ public class CategoryTemplates extends CMSContainer {
|
||||||
m_type = new SingleSelect(type.getStateParameter());
|
m_type = new SingleSelect(type.getStateParameter());
|
||||||
try {
|
try {
|
||||||
m_type.addPrintListener(new PrintListener() {
|
m_type.addPrintListener(new PrintListener() {
|
||||||
public void prepare(PrintEvent e) {
|
@Override
|
||||||
PageState state = e.getPageState();
|
public void prepare(PrintEvent event) {
|
||||||
|
PageState state = event.getPageState();
|
||||||
ContentSection section = ContentSectionServlet
|
ContentSection section = ContentSectionServlet
|
||||||
.getContentSection(state
|
.getContentSection(state
|
||||||
.getRequest());
|
.getRequest());
|
||||||
|
|
||||||
SingleSelect target = (SingleSelect)e.getTarget();
|
SingleSelect target = (SingleSelect)event.getTarget();
|
||||||
|
target.clearOptions();
|
||||||
|
|
||||||
ContentTypeCollection types = section.getContentTypes();
|
ContentTypeCollection types = section.getContentTypes();
|
||||||
types.addOrder(ContentType.LABEL);
|
types.addOrder(ContentType.LABEL);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue