From 0fd3188cf207a78ebce50cee148d1caa19de0218 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 13 Mar 2015 15:03:41 +0100 Subject: [PATCH] Fix LP export to PDF see BT#9559 --- main/newscorm/learnpath.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index 50f058a41f..244d64cd6b 100755 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -9498,6 +9498,7 @@ EOD; $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; @@ -9509,6 +9510,10 @@ EOD; 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);