From 2101d099c2c1cd4ba2d9180b9abb5d283466f3db Mon Sep 17 00:00:00 2001 From: Earle Nietzel Date: Tue, 27 Sep 2022 12:06:37 -0400 Subject: [PATCH] SAK-47764 Sitestats fix injection of Formattedtext in CHResourceModel (#10896) https://sakaiproject.atlassian.net/browse/SAK-47764 --- .../sitestats/tool/wicket/models/CHResourceModel.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sitestats/sitestats-tool/src/java/org/sakaiproject/sitestats/tool/wicket/models/CHResourceModel.java b/sitestats/sitestats-tool/src/java/org/sakaiproject/sitestats/tool/wicket/models/CHResourceModel.java index 277e8d7fe93f..a958aa771da1 100644 --- a/sitestats/sitestats-tool/src/java/org/sakaiproject/sitestats/tool/wicket/models/CHResourceModel.java +++ b/sitestats/sitestats-tool/src/java/org/sakaiproject/sitestats/tool/wicket/models/CHResourceModel.java @@ -21,6 +21,7 @@ */ package org.sakaiproject.sitestats.tool.wicket.models; +import org.apache.wicket.injection.Injector; import org.apache.wicket.model.IModel; import org.apache.wicket.spring.injection.annot.SpringBean; import org.sakaiproject.util.api.FormattedText; @@ -36,14 +37,15 @@ public class CHResourceModel implements IModel { boolean isCollection = false; public CHResourceModel(String resourceId, String resourceName) { - this.resourceId = resourceId; - this.resourceName = resourceName; + this(resourceId, resourceName, false); } public CHResourceModel(String resourceId, String resourceName, boolean isCollection) { this.resourceId = resourceId; this.resourceName = resourceName; this.isCollection = isCollection; + + Injector.get().inject(this); } public Object getObject() { @@ -84,4 +86,4 @@ public void detach() { resourceName = null; } -} \ No newline at end of file +}