Bug #966 - Importing learning paths from archives created with Chamilo 1.8.6.2 has been recovered.

skala
Ivan Tcholakov 15 years ago
parent 45565762fb
commit db4b5804f6
  1. 5
      main/coursecopy/classes/CourseArchiver.class.php

@ -206,7 +206,10 @@ class CourseArchiver
$fp = @fopen('course_info.dat', "r");
$contents = @fread($fp, filesize('course_info.dat'));
@fclose($fp);
$course = unserialize(base64_decode($contents));
// CourseCopyLearnpath class appeared in Chamilo 1.8.7, it is the former Learnpath class in the "Copy course" tool.
// For backward comaptibility with archives created on Chamilo 1.8.6.2 or older systems, we have to do the following:
// Before unserialization, if class name "Learnpath" was found, it should be renamed as "CourseCopyLearnpath".
$course = unserialize(str_replace('O:9:"Learnpath":', 'O:19:"CourseCopyLearnpath":', base64_decode($contents)));
if( get_class($course) != 'Course')
{
return new Course();

Loading…
Cancel
Save