From 985f07939b75bdcc0639536c11c31a67702a7f0d Mon Sep 17 00:00:00 2001
From: srosse <stephane.rosse@frentix.com>
Date: Mon, 11 Feb 2019 08:14:44 +0100
Subject: [PATCH] OO-3872: always load the repository entry with the binder

---
 .../org/olat/modules/portfolio/model/BinderImpl.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/olat/modules/portfolio/model/BinderImpl.java b/src/main/java/org/olat/modules/portfolio/model/BinderImpl.java
index a7569ffad14..b60ba892454 100644
--- a/src/main/java/org/olat/modules/portfolio/model/BinderImpl.java
+++ b/src/main/java/org/olat/modules/portfolio/model/BinderImpl.java
@@ -32,7 +32,6 @@ import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
-import javax.persistence.NamedQueries;
 import javax.persistence.NamedQuery;
 import javax.persistence.OneToMany;
 import javax.persistence.OrderColumn;
@@ -64,11 +63,12 @@ import org.olat.resource.OLATResourceImpl;
  */
 @Entity(name="pfbinder")
 @Table(name="o_pf_binder")
-@NamedQueries({
-	@NamedQuery(name="loadBinderByKey", query="select binder from pfbinder as binder inner join fetch binder.baseGroup as baseGroup where binder.key=:portfolioKey")
-	
-	
-})
+@NamedQuery(name="loadBinderByKey", query="select binder from pfbinder as binder" +
+											" inner join fetch binder.baseGroup as baseGroup" +
+											" left join fetch binder.entry as v" +
+											" left join fetch v.olatResource as res" +
+											" where binder.key=:portfolioKey")
+
 public class BinderImpl implements Persistable, ModifiedInfo, CreateInfo, Binder {
 
 	private static final long serialVersionUID = -2607615295380443760L;
-- 
GitLab