Skip to content

Commit 8ba13c4

Browse files
committed
LearnPath: Internals # fix lp visibility when there have been lp subscription in between - refs BT#23071
1 parent adad61f commit 8ba13c4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main/inc/lib/api.lib.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4338,14 +4338,19 @@ function api_get_item_visibility(
43384338
$groupCondition = " AND to_group_id = '$group_id' ";
43394339
}
43404340

4341+
$lpVisibilityCondition = '';
4342+
if ($tool === 'learnpath') {
4343+
$lpVisibilityCondition = " AND lastedit_type in ('LearnpathInvisible','LearnpathVisible') ";
4344+
}
4345+
43414346
$sql = "SELECT visibility
43424347
FROM $TABLE_ITEMPROPERTY
43434348
WHERE
43444349
c_id = $course_id AND
43454350
tool = '$tool' AND
43464351
ref = $id AND
43474352
(session_id = $session OR session_id = 0 OR session_id IS NULL)
4348-
$userCondition $typeCondition $groupCondition
4353+
$userCondition $typeCondition $groupCondition $lpVisibilityCondition
43494354
ORDER BY session_id DESC, lastedit_date DESC
43504355
LIMIT 1";
43514356

0 commit comments

Comments
 (0)