jenkins-bot has submitted this change and it was merged.

Change subject: Revert "Specify languages for MessageGroupStats and groups for 
LanguageStats"
......................................................................


Revert "Specify languages for MessageGroupStats and groups for LanguageStats"

This reverts commit f27217f039ad79ed7fc1459d90dd3c2a31069750.

This broke the hierarchy of aggregate groups on translatewiki.net. This
needs to be resolved before it can be merged again.

Change-Id: I398fbe99c0152552a1a780d1b4c8c4cf33b8bf6a
---
M specials/SpecialLanguageStats.php
M specials/SpecialMessageGroupStats.php
2 files changed, 14 insertions(+), 64 deletions(-)

Approvals:
  Siebrand: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/specials/SpecialLanguageStats.php 
b/specials/SpecialLanguageStats.php
index 9fd0908..2829b75 100644
--- a/specials/SpecialLanguageStats.php
+++ b/specials/SpecialLanguageStats.php
@@ -73,16 +73,6 @@
        protected $target;
 
        /**
-        * List of languages if specified (For Special:MessageGroupStats)
-        */
-       protected $langList = '';
-
-       /**
-        * List of groups if specified (For Special:LanguageStats)
-        */
-       protected $groupList = '';
-
-       /**
         * Whether to regenerate stats. Activated by action=purge in query 
params.
         * @var bool
         */
@@ -153,15 +143,6 @@
                        $this->noComplete && !$submitted
                );
                $this->noEmpty = $request->getBool( 'suppressempty', 
$this->noEmpty && !$submitted );
-
-               $this->langList = $request->getVal( 'languages' );
-               $this->groupList = $request->getVal( 'groups' );
-               // Neglecting other parameters if group list in 
Special:LanguageStats
-               // or language list in Special:MessageGroupStats passed
-               if ( $this->groupList || $this->langList ) {
-                       $this->noComplete = 0;
-                       $this->noEmpty = 0;
-               }
 
                if ( !$this->including() ) {
                        TranslateUtils::addSpecialHelpLink(
@@ -440,46 +421,20 @@
         * @return string
         */
        protected function makeGroupGroup( $item, array $cache, MessageGroup 
$parent = null ) {
-               // Check if user specified a list of groups required to display
-               if ( $this->groupList ) {
-                       $groups = explode( ',', $this->groupList );
-
-                       if ( !is_array( $item ) ) {
-                               // Include pages with a valid parent- Only 
selected groups' members are included
-                               if ( $parent !== null ) {
-                                       return $this->makeGroupRow( $item, 
$cache, $parent );
-                               }
-                               // Return nothing otherwise
-                               return '';
-                       }
-
-                       // The first group in the array is the parent 
AggregateMessageGroup
-                       $out = '';
-                       $top = array_shift( $item );
-
-                       if ( in_array( $top->getId(), $groups ) ) {
-                               $out .= $this->makeGroupRow( $top, $cache );
-
-                               // Children for the aggregate group
-                               foreach ( $item as $subgroup ) {
-                                       $out .= $this->makeGroupGroup( 
$subgroup, $cache, $top );
-                               }
-                       }
-               } else {
-                       // If user doesn't specify a list, display all groups
-                       // If the object is not an array make a row.
-                       if ( !is_array( $item ) ) {
-                               return $this->makeGroupRow( $item, $cache, 
$parent );
-                       }
-                       // If it is an array, the first group in the array is 
the parent AggregateMessageGroup
-                       $out = '';
-                       $top = array_shift( $item );
-                       $out .= $this->makeGroupRow( $top, $cache );
-                       // Children for the aggregate group
-                       foreach ( $item as $subgroup ) {
-                               $out .= $this->makeGroupGroup( $subgroup, 
$cache, $top );
-                       }
+               if ( !is_array( $item ) ) {
+                       return $this->makeGroupRow( $item, $cache, $parent );
                }
+
+               // The first group in the array is the parent 
AggregateMessageGroup
+               $out = '';
+               $top = array_shift( $item );
+               $out .= $this->makeGroupRow( $top, $cache, $parent );
+
+               // Rest are children
+               foreach ( $item as $subgroup ) {
+                       $out .= $this->makeGroupGroup( $subgroup, $cache, $top 
);
+               }
+
                return $out;
        }
 
diff --git a/specials/SpecialMessageGroupStats.php 
b/specials/SpecialMessageGroupStats.php
index 6d8703d..766ba79 100644
--- a/specials/SpecialMessageGroupStats.php
+++ b/specials/SpecialMessageGroupStats.php
@@ -155,12 +155,7 @@
                MessageGroupStats::setTimeLimit( $this->timelimit );
                $cache = MessageGroupStats::forGroup( $this->target );
 
-               if ( $this->langList ) {
-                       $languages = explode( ',', $this->langList );
-                       $languages = array_filter( $languages, 
'Language::isKnownLanguageTag' );
-               } else {
-                       $languages = array_keys( Language::fetchLanguageNames() 
);
-               }
+               $languages = array_keys( Language::fetchLanguageNames() );
                sort( $languages );
                $this->filterPriorityLangs( $languages, $this->target, $cache );
                foreach ( $languages as $code ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/132383
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I398fbe99c0152552a1a780d1b4c8c4cf33b8bf6a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: Kunalgrover05 <kunalgrove...@gmail.com>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to