Index: lib/pagelib.php =================================================================== RCS file: /home/cvs_repositories/globalcvs/ou-moodle/lib/pagelib.php,v retrieving revision 1.19 diff -u -r1.19 pagelib.php --- lib/pagelib.php 5 Nov 2007 08:19:01 -0000 1.19 +++ lib/pagelib.php 5 Dec 2007 16:32:38 -0000 @@ -589,9 +589,7 @@ if(empty($this->activityname)) { error('Page object derived from page_generic_activity but did not define $this->activityname'); } - $module = get_record('modules', 'name', $this->activityname); - $this->modulerecord = get_record('course_modules', 'module', $module->id, 'instance', $this->id); - if(empty($this->modulerecord)) { + if (!$this->modulerecord = get_coursemodule_from_id($this->activityname, $this->id)) { error('Cannot fully initialize page: invalid '.$this->activityname.' instance id '. $this->id); } $this->courserecord = get_record('course', 'id', $this->modulerecord->course);