Fix LP export to PDF see BT#9559

1.9.x
Julio Montoya 11 years ago
parent 71fe825607
commit 0fd3188cf2
  1. 5
      main/newscorm/learnpath.class.php

@ -9498,6 +9498,7 @@ EOD;
$lp_id = intval($lp_id); $lp_id = intval($lp_id);
$files_to_export = array(); $files_to_export = array();
$course_data = api_get_course_info($this->cc); $course_data = api_get_course_info($this->cc);
$sessionId = api_get_session_id();
if (!empty($course_data)) { if (!empty($course_data)) {
$scorm_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/scorm/'.$this->path; $scorm_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/scorm/'.$this->path;
@ -9509,6 +9510,10 @@ EOD;
case 'document': case 'document':
//Getting documents from a LP with chamilo documents //Getting documents from a LP with chamilo documents
$file_data = DocumentManager::get_document_data_by_id($item->path, $this->cc); $file_data = DocumentManager::get_document_data_by_id($item->path, $this->cc);
// Try loading document from the base course.
if (empty($file_data) && !empty($sessionId)) {
$file_data = DocumentManager::get_document_data_by_id($item->path, $this->cc, false, 0);
}
$file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$file_data['path']; $file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$file_data['path'];
if (file_exists($file_path)) { if (file_exists($file_path)) {
$files_to_export[] = array('title'=>$item->get_title(),'path'=>$file_path); $files_to_export[] = array('title'=>$item->get_title(),'path'=>$file_path);

Loading…
Cancel
Save