If no title then use the url. See BT#7311

1.9.x
Julio Montoya 11 years ago
parent 16588eef19
commit 6e0f1499ec
  1. 9
      main/work/work.lib.php

@ -214,11 +214,14 @@ function get_work_data_by_id($id)
$work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
$sql = "SELECT * FROM $work_table WHERE id = $id AND c_id = $course_id";
$result = Database::query($sql);
$return = array();
$work = array();
if (Database::num_rows($result)) {
$return = Database::fetch_array($result, 'ASSOC');
$work = Database::fetch_array($result, 'ASSOC');
if (empty($work['title'])) {
$work['title'] = basename($work['url']);
}
}
return $return;
return $work;
}
/**

Loading…
Cancel
Save