Manybubbles has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/95167


Change subject: Skip pages without revisions in forceSearchIndex
......................................................................

Skip pages without revisions in forceSearchIndex

Without this pages without revisions would cause forceSearchIndex to crash
as it checks if they are redirects.

Bug: 56965
Change-Id: I68d79278a0932ae18db73203c3730165cdc3e398
---
M maintenance/forceSearchIndex.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/67/95167/1

diff --git a/maintenance/forceSearchIndex.php b/maintenance/forceSearchIndex.php
index 6cf3900..4987208 100644
--- a/maintenance/forceSearchIndex.php
+++ b/maintenance/forceSearchIndex.php
@@ -212,7 +212,11 @@
                $result = array();
                foreach ( $res as $row ) {
                        $page = WikiPage::newFromRow( $row, 
WikiPage::READ_LATEST );
-                       if ( $page->getContent()->isRedirect() ) {
+                       $content = $page->getContent();
+                       if ( $content === null ) {
+                               // Skip pages without content
+                               $page = null;
+                       } else if ( $content->isRedirect() ) {
                                if ( $maxUpdate === null ) {
                                        // Looks like we accidentally picked up 
a redirect when we were indexing by id and thus trying to
                                        // ignore redirects!  It must not be 
marked properly in the database.  Just ignore it!

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I68d79278a0932ae18db73203c3730165cdc3e398
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Manybubbles <never...@wikimedia.org>

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

Reply via email to