Skip to content

Commit

Permalink
Fix issue with course info not available in Oogie documents conversio…
Browse files Browse the repository at this point in the history
…n - refs BT#10596
  • Loading branch information
ywarnier committed Jan 7, 2016
1 parent d9b4c01 commit 06a8759
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main/newscorm/learnpath.class.php
Expand Up @@ -492,6 +492,11 @@ public function add_item(
if ($this->debug > 0) {
error_log('New LP - In learnpath::add_item(' . $parent . ',' . $previous . ',' . $type . ',' . $id . ',' . $title . ')', 0);
}
if (empty($course_id)) {
// Sometimes Oogie doesn't catch the course info but sets $this->cc
$this->course_info = api_get_course_info($this->cc);
$course_id = $this->course_info['real_id'];
}
$tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
$_course = $this->course_info;
$parent = intval($parent);
Expand Down
2 changes: 2 additions & 0 deletions main/newscorm/openoffice_document.class.php
Expand Up @@ -151,6 +151,8 @@ public function convert_document($file, $action_after_conversion = 'make_lp')
if (!empty($files)) {
// Create lp
$this->lp_id = learnpath::add_lp($_course['id'], $this->file_name, '', 'guess', 'manual');
// make sure we have a course code available for later
$this->cc = $_course['id'];

// Call to the function implemented by child following action_after_conversion parameter.
switch ($action_after_conversion) {
Expand Down

0 comments on commit 06a8759

Please sign in to comment.