From cff3d8debbf163cc1e58108bd3f5f944f69cd96a Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 15 Jul 2015 11:56:27 +0200 Subject: [PATCH] Fix course copy, query and fatal errors --- .../classes/CourseBuilder.class.php | 1 + .../classes/CourseRestorer.class.php | 1 + main/coursecopy/classes/wiki.class.php | 23 +++++++++---------- main/coursecopy/copy_course.php | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/main/coursecopy/classes/CourseBuilder.class.php b/main/coursecopy/classes/CourseBuilder.class.php index a34ced0f21..f339f1807e 100755 --- a/main/coursecopy/classes/CourseBuilder.class.php +++ b/main/coursecopy/classes/CourseBuilder.class.php @@ -1,6 +1,7 @@ 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() diff --git a/main/coursecopy/copy_course.php b/main/coursecopy/copy_course.php index 7054c3e578..c8b2e84e9e 100755 --- a/main/coursecopy/copy_course.php +++ b/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) {