r21546 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21545‎ | r21546 | r21547 >
Date:21:02, 24 April 2007
Author:aaron
Status:old
Tags:
Comment:
*Clean up some other notices due to inconsistent hook triggering
Modified paths:
  • /trunk/extensions/StableVersion/StableVersion.php (modified) (history)

Diff [purge]

Index: trunk/extensions/StableVersion/StableVersion.php
@@ -30,6 +30,10 @@
3131 # Evil variables, needed internally
3232 $wgStableVersionCaching = false;
3333
 34+# Every user can mark stable versions (default)
 35+# To change this, add this line to localsettings.php and modify
 36+$wgGroupPermissions['user']['stableversion'] = true;
 37+
3438 $wgExtensionCredits['StableVersion'][] = array(
3539 'name' => 'Stable version',
3640 'description' => 'An extension to allow the marking of a stable version.',
@@ -190,11 +194,11 @@
191195 * @return bool (always TRUE by default, for testing)
192196 */
193197 function wfStableVersionCanChange() {
194 - return true; # Dummy, everyone can set stable versions
 198+ //return true; # Dummy, everyone can set stable versions
195199 global $wgUser, $wgOut;
196200 if( !$wgUser->isAllowed( 'stableversion' ) ) {
197 - #$wgOut->permissionRequired( 'stableversion' );
198 - #$wgOut->setSubtitle( wfMsg('stableversion') );
 201+ $wgOut->permissionRequired( 'stableversion' );
 202+ $wgOut->setSubtitle( wfMsg('stableversion') );
199203 return false;
200204 }
201205 return true;
@@ -212,6 +216,11 @@
213217 wfStableVersionAddCache();
214218 $st = ""; # Subtitle
215219
 220+ # Gah...these hooks are not consistant
 221+ # Load if not loaded to avoid errors - Aaron
 222+ if ( !isset($article->mIsStable) )
 223+ wfStableVersionSetArticleVersionStatusAndCache( $article, $article->getRevIdFetched() );
 224+
216225 if( $article->mIsStable ) {
217226 # This is the stable version
218227 if( $article->mLatest == $article->mLastStable ) {