diff --git a/lib/pagelib.php b/lib/pagelib.php
index <HASH>..<HASH> 100644
--- a/lib/pagelib.php
+++ b/lib/pagelib.php
@@ -49,9 +49,15 @@ function page_create_object($type, $id = NULL) {
  */
 
 function page_map_class($type, $classname = NULL) {
-    static $mappings = array(
-        MOODLE_PAGE_COURSE => 'page_course'
-    );
+    static $mappings = NULL;
+    
+    if($mappings === NULL) {
+        $mappings = array(
+            MOODLE_PAGE_COURSE => 'page_course'
+        );
+        print_object('Debug info - initial mappings:');
+        var_dump($mappings);
+    }
 
     if(!empty($type) && !empty($classname)) {
         $mappings[$type] = $classname;
A small change for the static initialization in page_map_class,
and more debug added just before init is done.