[MediaWiki-commits] [Gerrit] Fix undefined index error - change (mediawiki...ArticlePlaceholder)

2016-06-06 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix undefined index error
..


Fix undefined index error

Bug: T136093
Change-Id: I72f1f634c8e339285a5e9864a2b9709b044ffd55
(cherry picked from commit d9e531ae3a266f599833bdeda8947a65a68387f8)
---
M includes/SearchHookHandler.php
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/includes/SearchHookHandler.php b/includes/SearchHookHandler.php
index 453d70f..14cb36d 100644
--- a/includes/SearchHookHandler.php
+++ b/includes/SearchHookHandler.php
@@ -153,6 +153,10 @@
 
$notableEntityIds = $this->getNotableEntityIds( array_keys( 
$entityIdSearchResult ) );
 
+   if ( $notableEntityIds === null ) {
+   return '';
+   }
+
foreach ( $notableEntityIds as $entityId ) {
$result = $this->createResult( $entityIdSearchResult[ 
$entityId ] );
 
@@ -239,7 +243,7 @@
// $json will be false if the request fails, json_decode can 
handle that.
$data = json_decode( $json, true );
 
-   if ( is_array( $data ) ) {
+   if ( is_array( $data ) && array_key_exists( 'entities', $data ) 
) {
return $data[ 'entities' ];
} else {
return null;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I72f1f634c8e339285a5e9864a2b9709b044ffd55
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticlePlaceholder
Gerrit-Branch: wmf/1.28.0-wmf.3
Gerrit-Owner: Aude 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Lucie Kaffee 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Fix undefined index error - change (mediawiki...ArticlePlaceholder)

2016-06-06 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Fix undefined index error
..

Fix undefined index error

Bug: T136093
Change-Id: I72f1f634c8e339285a5e9864a2b9709b044ffd55
(cherry picked from commit d9e531ae3a266f599833bdeda8947a65a68387f8)
---
M includes/SearchHookHandler.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticlePlaceholder 
refs/changes/45/293045/1

diff --git a/includes/SearchHookHandler.php b/includes/SearchHookHandler.php
index 453d70f..14cb36d 100644
--- a/includes/SearchHookHandler.php
+++ b/includes/SearchHookHandler.php
@@ -153,6 +153,10 @@
 
$notableEntityIds = $this->getNotableEntityIds( array_keys( 
$entityIdSearchResult ) );
 
+   if ( $notableEntityIds === null ) {
+   return '';
+   }
+
foreach ( $notableEntityIds as $entityId ) {
$result = $this->createResult( $entityIdSearchResult[ 
$entityId ] );
 
@@ -239,7 +243,7 @@
// $json will be false if the request fails, json_decode can 
handle that.
$data = json_decode( $json, true );
 
-   if ( is_array( $data ) ) {
+   if ( is_array( $data ) && array_key_exists( 'entities', $data ) 
) {
return $data[ 'entities' ];
} else {
return null;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72f1f634c8e339285a5e9864a2b9709b044ffd55
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticlePlaceholder
Gerrit-Branch: wmf/1.28.0-wmf.3
Gerrit-Owner: Aude 
Gerrit-Reviewer: Lucie Kaffee 

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


[MediaWiki-commits] [Gerrit] Fix undefined index error - change (mediawiki...ArticlePlaceholder)

2016-05-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix undefined index error
..


Fix undefined index error

Bug: T136093
Change-Id: I72f1f634c8e339285a5e9864a2b9709b044ffd55
---
M includes/SearchHookHandler.php
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Hoo man: Looks good to me, approved
  Thiemo Mättig (WMDE): Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/SearchHookHandler.php b/includes/SearchHookHandler.php
index 453d70f..14cb36d 100644
--- a/includes/SearchHookHandler.php
+++ b/includes/SearchHookHandler.php
@@ -153,6 +153,10 @@
 
$notableEntityIds = $this->getNotableEntityIds( array_keys( 
$entityIdSearchResult ) );
 
+   if ( $notableEntityIds === null ) {
+   return '';
+   }
+
foreach ( $notableEntityIds as $entityId ) {
$result = $this->createResult( $entityIdSearchResult[ 
$entityId ] );
 
@@ -239,7 +243,7 @@
// $json will be false if the request fails, json_decode can 
handle that.
$data = json_decode( $json, true );
 
-   if ( is_array( $data ) ) {
+   if ( is_array( $data ) && array_key_exists( 'entities', $data ) 
) {
return $data[ 'entities' ];
} else {
return null;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I72f1f634c8e339285a5e9864a2b9709b044ffd55
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticlePlaceholder
Gerrit-Branch: master
Gerrit-Owner: Lucie Kaffee 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Fix undefined index error - change (mediawiki...ArticlePlaceholder)

2016-05-24 Thread Lucie Kaffee (Code Review)
Lucie Kaffee has uploaded a new change for review.

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

Change subject: Fix undefined index error
..

Fix undefined index error

Bug: T136093
Change-Id: I72f1f634c8e339285a5e9864a2b9709b044ffd55
---
M includes/SearchHookHandler.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticlePlaceholder 
refs/changes/76/290476/1

diff --git a/includes/SearchHookHandler.php b/includes/SearchHookHandler.php
index 453d70f..14cb36d 100644
--- a/includes/SearchHookHandler.php
+++ b/includes/SearchHookHandler.php
@@ -153,6 +153,10 @@
 
$notableEntityIds = $this->getNotableEntityIds( array_keys( 
$entityIdSearchResult ) );
 
+   if ( $notableEntityIds === null ) {
+   return '';
+   }
+
foreach ( $notableEntityIds as $entityId ) {
$result = $this->createResult( $entityIdSearchResult[ 
$entityId ] );
 
@@ -239,7 +243,7 @@
// $json will be false if the request fails, json_decode can 
handle that.
$data = json_decode( $json, true );
 
-   if ( is_array( $data ) ) {
+   if ( is_array( $data ) && array_key_exists( 'entities', $data ) 
) {
return $data[ 'entities' ];
} else {
return null;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72f1f634c8e339285a5e9864a2b9709b044ffd55
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticlePlaceholder
Gerrit-Branch: master
Gerrit-Owner: Lucie Kaffee 

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