[svn r19514] minor - logic changes - fixed warning when you remove course - (partial FS#3909)

skala
Isaac Flores 16 years ago
parent 7ff6fcff69
commit b7121c1d8b
  1. 22
      main/inc/lib/course.lib.php

@ -1680,21 +1680,21 @@ class CourseManager
$sql = "SELECT distinct field_id FROM $t_cfv";
$res_field_all_ids = @api_sql_query($sql,__FILE__,__LINE__);
while($row_field_all_id = Database::fetch_row($res_field_all_ids)){
while ($row_field_all_id = Database::fetch_row($res_field_all_ids)){
$field_all_ids[] = $row_field_all_id[0];
}
foreach($field_ids as $field_id) {
if (count($field_ids)>0) {
foreach($field_ids as $field_id) {
// check if field id is used into table field value
if (is_array($field_all_ids)) {
if (in_array($field_id,$field_all_ids)) {
continue;
} else {
$sql_course_field = "DELETE FROM $t_cf WHERE id = '$field_id'";
api_sql_query($sql_course_field,__FILE__,__LINE__);
}
if (is_array($field_all_ids)) {
if (in_array($field_id,$field_all_ids)) {
continue;
} else {
$sql_course_field = "DELETE FROM $t_cf WHERE id = '$field_id'";
api_sql_query($sql_course_field,__FILE__,__LINE__);
}
}
}
}
}

Loading…
Cancel
Save