Skip to content

Commit e5550b9

Browse files
committed
Learnpath: when deleting a LP remove all prerequisite based on this LP -refs BT#21369
1 parent fc80cf6 commit e5550b9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main/lp/learnpath.class.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,11 @@ public function delete($courseInfo = null, $id = null, $delete = 'keep')
11381138
// Updates the display order of all lps.
11391139
$this->update_display_order();
11401140

1141+
// Remove prerequisite based on the deleted LP
1142+
$sql = "UPDATE $lp
1143+
SET prerequisite = 0 where c_id = $course_id AND prerequisite = ".$this->lp_id;
1144+
Database::query($sql);
1145+
11411146
api_item_property_update(
11421147
api_get_course_info(),
11431148
TOOL_LEARNPATH,

0 commit comments

Comments
 (0)