Revert r59537. Breaks page deletion with "PHP Notice: Array to string conversion...
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 29 Nov 2009 10:49:47 +0000 (10:49 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 29 Nov 2009 10:49:47 +0000 (10:49 +0000)
includes/LogEventsList.php

index 131493d..3510988 100644 (file)
@@ -790,13 +790,10 @@ class LogPager extends ReverseChronologicalPager {
                $types = ($types === '') ? array() : (array)$types;
                // Don't even show header for private logs; don't recognize it...
                foreach ( $types as $type ) {
-                       if( isset( $wgLogRestrictions[$type] )
-                               && !$wgUser->isAllowed($wgLogRestrictions[$type])
-                       ) {
+                       if( isset( $wgLogRestrictions[$type] ) && !$wgUser->isAllowed($wgLogRestrictions[$type]) ) {
                                $types = array_diff( $types, array( $type ) );
                        }
                }
-               $this->types = $types;
                // Don't show private logs to unprivileged users.
                // Also, only show them upon specific request to avoid suprises.
                $audience = $types ? 'user' : 'public';
@@ -805,6 +802,7 @@ class LogPager extends ReverseChronologicalPager {
                        $this->mConds[] = $hideLogs;
                }
                if( count($types) ) {
+                       $this->types = $types;
                        $this->mConds['log_type'] = $types;
                        // Set typeCGI; used in url param for paging
                        if( count($types) == 1 ) $this->typeCGI = $types[0];
@@ -892,25 +890,18 @@ class LogPager extends ReverseChronologicalPager {
                $tables = array( 'logging', 'user' );
                $this->mConds[] = 'user_id = log_user';
                $groupBy = false;
-               $index = array();
                # Add log_search table if there are conditions on it
                if( array_key_exists('ls_field',$this->mConds) ) {
                        $tables[] = 'log_search';
-                       $index['log_search'] = 'ls_field_val';
-                       $index['logging'] = 'PRIMARY';
+                       $index = array( 'log_search' => 'ls_field_val', 'logging' => 'PRIMARY' );
                        $groupBy = 'ls_log_id';
-               # Avoid usage of the wrong index by limiting
-               # the choices of available indexes. This mainly
-               # avoids site-breaking filesorts.
+               # Don't use the wrong logging index
                } else if( $this->title || $this->pattern || $this->user ) {
-                       $index['logging'] = array( 'page_time', 'user_time' );
-                       if( count($this->types) == 1 ) {
-                               $index['logging'][] = array( 'log_user_type_time' );
-                       }
-               } else if( count($this->types) == 1 ) {
-                       $index['logging'] = 'type_time';
+                       $index = array( 'logging' => array('page_time','user_time') );
+               } else if( $this->types ) {
+                       $index = array( 'logging' => 'type_time' );
                } else {
-                       $index['logging'] = 'times';
+                       $index = array( 'logging' => 'times' );
                }
                $options = array( 'USE INDEX' => $index );
                # Don't show duplicate rows when using log_search