Removed view event from $wgAutopromoteOnce
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 26 Mar 2015 22:47:33 +0000 (15:47 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 26 Mar 2015 22:47:33 +0000 (15:47 -0700)
* This avoids master queries on view. It could use local jobs, but nothing
  was using this by default anyway.

Bug: T92357
Change-Id: Id6353942215a3c704848d3bcc31c2b76225c78be

RELEASE-NOTES-1.25
includes/DefaultSettings.php
includes/MediaWiki.php
includes/page/WikiPage.php

index 6462767..b7a1a8e 100644 (file)
@@ -45,6 +45,8 @@ production.
 * The 'daemonized' flag must be set to true in $wgJobTypeConf for any redis
   job queues. This means that mediawiki/services/jobrunner service has to
   be installed and running for any such queues to work.
+* $wgAutopromoteOnce no longer supports the 'view' event. For keeping some
+  compatibility, any 'view' event triggers will still trigger on 'edit'.
 
 === New features in 1.25 ===
 * (T64861) Updated plural rules to CLDR 26. Includes incompatible changes
index 1df809e..5ab557e 100644 (file)
@@ -4863,7 +4863,6 @@ $wgAutopromote = array(
  * @endcode
  * Where event is either:
  *    - 'onEdit' (when user edits)
- *    - 'onView' (when user views the wiki)
  *
  * Criteria has the same format as $wgAutopromote
  *
@@ -4872,7 +4871,6 @@ $wgAutopromote = array(
  */
 $wgAutopromoteOnce = array(
        'onEdit' => array(),
-       'onView' => array()
 );
 
 /**
index 2644023..c086a39 100644 (file)
@@ -199,8 +199,6 @@ class MediaWiki {
                        throw new PermissionsError( 'read', $permErrors );
                }
 
-               $pageView = false; // was an article or special page viewed?
-
                // Interwiki redirects
                if ( $title->isExternal() ) {
                        $rdfrom = $request->getVal( 'rdfrom' );
@@ -263,7 +261,6 @@ class MediaWiki {
                        }
                // Special pages
                } elseif ( NS_SPECIAL == $title->getNamespace() ) {
-                       $pageView = true;
                        // Actions that need to be made when we have a special pages
                        SpecialPageFactory::executePath( $title, $this->context );
                } else {
@@ -271,7 +268,6 @@ class MediaWiki {
                        // may be a redirect to another article or URL.
                        $article = $this->initializeArticle();
                        if ( is_object( $article ) ) {
-                               $pageView = true;
                                $this->performAction( $article, $requestTitle );
                        } elseif ( is_string( $article ) ) {
                                $output->redirect( $article );
@@ -280,12 +276,6 @@ class MediaWiki {
                                        . " returned neither an object nor a URL" );
                        }
                }
-
-               if ( $pageView ) {
-                       // Promote user to any groups they meet the criteria for
-                       $user->addAutopromoteOnceGroups( 'onView' );
-               }
-
        }
 
        /**
index 2315dc7..0452c41 100644 (file)
@@ -1992,6 +1992,7 @@ class WikiPage implements Page, IDBAccessObject {
                // Promote user to any groups they meet the criteria for
                $dbw->onTransactionIdle( function () use ( $user ) {
                        $user->addAutopromoteOnceGroups( 'onEdit' );
+                       $user->addAutopromoteOnceGroups( 'onView' ); // b/c
                } );
 
                return $status;