From a8c310c25326da7ace71bcb14264f52fbcd84a59 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 21 Jul 2009 13:58:47 +0000 Subject: [PATCH] Fix new install with developer debug on. Can't print context name in the page footer before DB tables exist! Also, show page generaltype in the footer. --- lib/pagelib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/pagelib.php b/lib/pagelib.php index 1d63fee10e0..ca65ed31a15 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -483,10 +483,15 @@ class moodle_page { } /** - * @return string a description of this page (context, page-type and sub-page. + * @return string a description of this page. Normally displayed in the footer in + * developer debug mode. */ public function debug_summary() { - $summary = 'Context ' . print_context_name($this->context) . ' (context id ' . $this->context->id . '). '; + $summary = ''; + $summary .= 'General type: ' . $this->generaltype . '. '; + if (!during_initial_install()) { + $summary .= 'Context ' . print_context_name($this->context) . ' (context id ' . $this->context->id . '). '; + } $summary .= 'Page type ' . $this->pagetype . '. '; if ($this->subpage) { 'Sub-page ' . $this->subpage . '. ';