Skip to content

Commit

Permalink
Fix LP export to PDF see BT#9559
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Mar 13, 2015
1 parent 71fe825 commit 0fd3188
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main/newscorm/learnpath.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -9498,6 +9498,7 @@ public function scorm_export_to_pdf($lp_id)
$lp_id = intval($lp_id);
$files_to_export = array();
$course_data = api_get_course_info($this->cc);
$sessionId = api_get_session_id();
if (!empty($course_data)) {
$scorm_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/scorm/'.$this->path;

Expand All @@ -9509,6 +9510,10 @@ public function scorm_export_to_pdf($lp_id)
case 'document':
//Getting documents from a LP with chamilo documents
$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'];
if (file_exists($file_path)) {
$files_to_export[] = array('title'=>$item->get_title(),'path'=>$file_path);
Expand Down

0 comments on commit 0fd3188

Please sign in to comment.