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

Change subject: Hygiene: Don't assume, that all pages has text extracts
......................................................................


Hygiene: Don't assume, that all pages has text extracts

E.g. if you have nonexistent pages in your watchlist, they never has
an extracts key in Api return.

Change-Id: Ifb29cfa8151f2fe0d9d656cdeb9c196cccf57f18
---
M includes/stores/ItemExtracts.php
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/includes/stores/ItemExtracts.php b/includes/stores/ItemExtracts.php
index 3a766b0..ce0aea8 100644
--- a/includes/stores/ItemExtracts.php
+++ b/includes/stores/ItemExtracts.php
@@ -35,7 +35,11 @@
 
                $extracts = array();
                foreach ( $pages as $page ) {
-                       $extracts[] = $page['extract']['*'];
+                       if ( isset( $page['extract']['*'] ) ) {
+                               $extracts[] = $page['extract']['*'];
+                       } else {
+                               $extracts[] = null;
+                       }
                }
                return $extracts;
        }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifb29cfa8151f2fe0d9d656cdeb9c196cccf57f18
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Jhernandez <[email protected]>
Gerrit-Reviewer: Robmoen <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to