Skip to content

Commit d005bcd

Browse files
committed
Document: # fix total document tool size usage calculation to avoid DELETED documents that have many registries in c_item_property - refs BT#22562
1 parent 5b3755b commit d005bcd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

main/inc/lib/document.lib.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3300,7 +3300,14 @@ public static function documents_total_space($course_id = null, $group_id = null
33003300
props.c_id = $course_id AND
33013301
docs.c_id = $course_id AND
33023302
props.tool = '".TOOL_DOCUMENT."' AND
3303-
props.visibility <> 2
3303+
props.ref not in (
3304+
SELECT ref
3305+
FROM $TABLE_ITEMPROPERTY as cip
3306+
WHERE
3307+
cip.c_id = $course_id AND
3308+
cip.tool = '".TOOL_DOCUMENT."' AND
3309+
cip.visibility = 2
3310+
)
33043311
$group_condition
33053312
$session_condition
33063313
";

0 commit comments

Comments
 (0)