Skip to content

Commit 3873361

Browse files
committed
Merge branch 'hotfix/2021.1.5' into stable-2021.1
2 parents dad59c0 + c177e4a commit 3873361

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/api/entity/PagedResults.scala

+8-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,14 @@ object PagedResults {
8181
}
8282

8383
def getAvailable: Int = {
84-
// It's acceptable to retrieve all because targeted BaseEntities are all small datasets.
85-
val entities = getBaseEntities(0, -1)
86-
filterByPermission(entities).length
84+
// We only return the full number of available entities because filtering entities by ACL is very slow.
85+
// Here is an example that would it.
86+
// val entities = getBaseEntities(0, -1)
87+
// filterByPermission(entities).length
88+
89+
res.getEntityService
90+
.countAll(new EnumerateOptions(q, 0, -1, system, if (includeDisabled) null else false))
91+
.toInt
8792
}
8893

8994
def collectMore(length: Int, initialOffset: Int): (Int, List[PagedEntity[BE]]) = {

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ name := "Equella"
116116

117117
equellaMajor in ThisBuild := 2021
118118
equellaMinor in ThisBuild := 1
119-
equellaPatch in ThisBuild := 4
119+
equellaPatch in ThisBuild := 5
120120
equellaStream in ThisBuild := "Stable"
121121
equellaBuild in ThisBuild := buildConfig.value.getString("build.buildname")
122122

0 commit comments

Comments
 (0)