Made monobook work when $wgArticle is null, this is currently the case on a read...
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 19 Aug 2006 03:11:49 +0000 (03:11 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 19 Aug 2006 03:11:49 +0000 (03:11 +0000)
includes/SkinTemplate.php

index 496219d..a3580d9 100644 (file)
@@ -320,7 +320,9 @@ class SkinTemplate extends Skin {
                $tpl->setRef( 'newtalk', $ntl );
                $tpl->setRef( 'skin', $this);
                $tpl->set( 'logo', $this->logoText() );
-               if ( $wgOut->isArticle() and (!isset( $oldid ) or isset( $diff )) and 0 != $wgArticle->getID() ) {
+               if ( $wgOut->isArticle() and (!isset( $oldid ) or isset( $diff )) and 
+                       $wgArticle and 0 != $wgArticle->getID() ) 
+               {
                        if ( !$wgDisableCounters ) {
                                $viewcount = $wgLang->formatNum( $wgArticle->getCount() );
                                if ( $viewcount ) {
@@ -814,7 +816,7 @@ class SkinTemplate extends Skin {
                // A print stylesheet is attached to all pages, but nobody ever
                // figures that out. :)  Add a link...
                if( $this->iscontent && ($action == '' || $action == 'view' || $action == 'purge' ) ) {
-                       $revid = $wgArticle->getLatest();
+                       $revid = $wgArticle ? $wgArticle->getLatest() : 0;
                        if ( !( $revid == 0 )  )
                                $nav_urls['print'] = array(
                                        'text' => wfMsg( 'printableversion' ),