[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: ApiQueryContentTranslation: Fix php warnings

2017-11-06 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/388388 )

Change subject: ApiQueryContentTranslation: Fix php warnings
..


ApiQueryContentTranslation: Fix php warnings

Fixes the following 2 warnings observed in production:

Notice: Undefined property: ApiQueryContentTranslation::$user in
/srv/mediawiki/php-1.31.0-wmf.6/extensions/ContentTranslation/api/
ApiQueryContentTranslation.php on line 120

Notice: Undefined variable: translation in /srv/mediawiki/php-1.31.0-wmf.6/
extensions/ContentTranslation/api/ApiQueryContentTranslation.php on line 126

Change-Id: If3871eb0d5ff5fedbaef3f20edff7fa1ccd808db
---
M api/ApiQueryContentTranslation.php
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/api/ApiQueryContentTranslation.php 
b/api/ApiQueryContentTranslation.php
index ea16f03..5b91733 100644
--- a/api/ApiQueryContentTranslation.php
+++ b/api/ApiQueryContentTranslation.php
@@ -116,8 +116,9 @@
 * @param Translator $translator
 */
public function find( TranslationWork $work, Translator $translator ) {
+   $translation = null;
$result = $this->getResult();
-   if ( $this->user ) {
+   if ( isset( $this->user ) ) {
$translation = Translation::findForTranslator( $work, 
$translator );
}
// Check for other drafts. If one exists, return that to the UI 
which will then

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If3871eb0d5ff5fedbaef3f20edff7fa1ccd808db
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: ApiQueryContentTranslation: Fix php warnings

2017-11-02 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/388388 )

Change subject: ApiQueryContentTranslation: Fix php warnings
..

ApiQueryContentTranslation: Fix php warnings

Fixes the following 2 warnings observed in production:

Notice: Undefined property: ApiQueryContentTranslation::$user in
/srv/mediawiki/php-1.31.0-wmf.6/extensions/ContentTranslation/api/
ApiQueryContentTranslation.php on line 120

Notice: Undefined variable: translation in /srv/mediawiki/php-1.31.0-wmf.6/
extensions/ContentTranslation/api/ApiQueryContentTranslation.php on line 126

Change-Id: If3871eb0d5ff5fedbaef3f20edff7fa1ccd808db
---
M api/ApiQueryContentTranslation.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/88/388388/1

diff --git a/api/ApiQueryContentTranslation.php 
b/api/ApiQueryContentTranslation.php
index ea16f03..5b91733 100644
--- a/api/ApiQueryContentTranslation.php
+++ b/api/ApiQueryContentTranslation.php
@@ -116,8 +116,9 @@
 * @param Translator $translator
 */
public function find( TranslationWork $work, Translator $translator ) {
+   $translation = null;
$result = $this->getResult();
-   if ( $this->user ) {
+   if ( isset( $this->user ) ) {
$translation = Translation::findForTranslator( $work, 
$translator );
}
// Check for other drafts. If one exists, return that to the UI 
which will then

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3871eb0d5ff5fedbaef3f20edff7fa1ccd808db
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh 

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