Просмотр исходного кода

Fix course copy, query and fatal errors

Julio Montoya 9 лет назад
Родитель
Сommit
cff3d8debb

+ 1 - 0
main/coursecopy/classes/CourseBuilder.class.php

@@ -1,6 +1,7 @@
 <?php
 /* For licensing terms, see /license.txt */
 
+require_once 'Resource.class.php';
 require_once 'Course.class.php';
 require_once 'Event.class.php';
 require_once 'Link.class.php';

+ 1 - 0
main/coursecopy/classes/CourseRestorer.class.php

@@ -1,6 +1,7 @@
 <?php
 /* For licensing terms, see /license.txt */
 
+require_once 'Resource.class.php';
 require_once 'Course.class.php';
 require_once 'Event.class.php';
 require_once 'Link.class.php';

+ 11 - 12
main/coursecopy/classes/wiki.class.php

@@ -1,6 +1,5 @@
 <?php
 /* For licensing terms, see /license.txt */
-require_once('Resource.class.php');
 
 /**
  * Class for migrating the wiki
@@ -33,17 +32,17 @@ class Wiki extends Resource
 		$progress,
 		$version
 	) {
-		parent::Resource($id,RESOURCE_WIKI);
-		$this->id						= $id;
-		$this->page_id					= $page_id;
-		$this->reflink 					= $reflink;
-		$this->title 					= $title;
-		$this->content					= $content;
-		$this->user_id					= $user_id;
-		$this->group_id					= $group_id;
-		$this->dtime					= $timestamp;
-		$this->progress					= $progress;
-		$this->version					= $version;
+		parent::__construct($id,RESOURCE_WIKI);
+        $this->id = $id;
+        $this->page_id = $page_id;
+        $this->reflink = $reflink;
+        $this->title = $title;
+        $this->content = $content;
+        $this->user_id = $user_id;
+        $this->group_id = $group_id;
+        $this->dtime = $timestamp;
+        $this->progress = $progress;
+        $this->version = $version;
 	}
 
 	function show()

+ 1 - 1
main/coursecopy/copy_course.php

@@ -92,7 +92,7 @@ if (Security::check_token('post') && (
     }
     $sql .= ' AND
             cu.user_id = '.$user_info['user_id'].' AND
-            c.c_id != '."'".$course_info['real_id']."'".'
+            c.id != '."'".$course_info['real_id']."'".'
             ORDER BY title ASC';
     $res = Database::query($sql);
     if (Database::num_rows($res) == 0) {