Skip to content

Commit 0fd3188

Browse files
committed
Fix LP export to PDF see BT#9559
1 parent 71fe825 commit 0fd3188

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main/newscorm/learnpath.class.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9498,6 +9498,7 @@ public function scorm_export_to_pdf($lp_id)
94989498
$lp_id = intval($lp_id);
94999499
$files_to_export = array();
95009500
$course_data = api_get_course_info($this->cc);
9501+
$sessionId = api_get_session_id();
95019502
if (!empty($course_data)) {
95029503
$scorm_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/scorm/'.$this->path;
95039504

@@ -9509,6 +9510,10 @@ public function scorm_export_to_pdf($lp_id)
95099510
case 'document':
95109511
//Getting documents from a LP with chamilo documents
95119512
$file_data = DocumentManager::get_document_data_by_id($item->path, $this->cc);
9513+
// Try loading document from the base course.
9514+
if (empty($file_data) && !empty($sessionId)) {
9515+
$file_data = DocumentManager::get_document_data_by_id($item->path, $this->cc, false, 0);
9516+
}
95129517
$file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$file_data['path'];
95139518
if (file_exists($file_path)) {
95149519
$files_to_export[] = array('title'=>$item->get_title(),'path'=>$file_path);

0 commit comments

Comments
 (0)