mod-page MDL-21590 Fixed recent regression in page whereby a var was being used before being created

This commit is contained in:
Sam Hemelryk 2010-02-23 08:08:28 +00:00
parent c2c16f70fd
commit 13fceaa4de

View File

@ -248,13 +248,13 @@ function page_get_coursemodule_info($coursemodule) {
global $CFG, $DB; global $CFG, $DB;
require_once("$CFG->libdir/resourcelib.php"); require_once("$CFG->libdir/resourcelib.php");
$info = new object();
$info->name = $page->name;
if (!$page = $DB->get_record('page', array('id'=>$coursemodule->instance), 'id, name, display, displayoptions')) { if (!$page = $DB->get_record('page', array('id'=>$coursemodule->instance), 'id, name, display, displayoptions')) {
return NULL; return NULL;
} }
$info = new object();
$info->name = $page->name;
if ($page->display != RESOURCELIB_DISPLAY_POPUP) { if ($page->display != RESOURCELIB_DISPLAY_POPUP) {
return $info; return $info;
} }