(bug 22627) Remove PHP notice when deleting a page only hidden users edited.
authorTobias <churchofemacs@users.mediawiki.org>
Mon, 29 Mar 2010 19:45:54 +0000 (19:45 +0000)
committerTobias <churchofemacs@users.mediawiki.org>
Mon, 29 Mar 2010 19:45:54 +0000 (19:45 +0000)
RELEASE-NOTES
includes/Article.php

index 2ddf0b5..ea7a829 100644 (file)
@@ -66,6 +66,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   links with non-NFC character references work correctly.
 * (bug 22991) wgUserGroups JavaScript variable now reports * group for
   anonymous users instead of null.
+* (bug 22627) Remove PHP notice when deleting a page only hidden users edited.
 
 == API changes in 1.17 ==
 * (bug 22738) Allow filtering by action type on query=logevent
index d0f8f74..eface19 100644 (file)
@@ -2545,13 +2545,17 @@ class Article {
 
                $hasHistory = ( $res->numRows() > 1 );
                $row = $dbw->fetchObject( $res );
-               $onlyAuthor = $row->rev_user_text;
-               // Try to find a second contributor
-               foreach ( $res as $row ) {
-                       if ( $row->rev_user_text != $onlyAuthor ) {
-                               $onlyAuthor = false;
-                               break;
+               if ( $row ) { // $row is false if the only contributor is hidden
+                       $onlyAuthor = $row->rev_user_text;
+                       // Try to find a second contributor
+                       foreach ( $res as $row ) {
+                               if ( $row->rev_user_text != $onlyAuthor ) { // Bug 22999
+                                       $onlyAuthor = false;
+                                       break;
+                               }
                        }
+               } else {
+                       $onlyAuthor = false;
                }
                $dbw->freeResult( $res );