Santhosh has uploaded a new change for review.

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

Change subject: Use Echo notifications only when Echo is available
......................................................................

Use Echo notifications only when Echo is available

Avoid publishing error if the wiki does not have Echo installed.
Produce notifications only if Echo available.

Testplan:
Disable Echo, and publish translations(1st, 10th or 100th translations)
Publishing should work without errors and without complaining about
Echo missing.

Change-Id: I96d2a0dce72970dfe33e5f6832d1e27b52da6f20
---
M api/ApiContentTranslationPublish.php
1 file changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/api/ApiContentTranslationPublish.php 
b/api/ApiContentTranslationPublish.php
index d31833c..e58c394 100755
--- a/api/ApiContentTranslationPublish.php
+++ b/api/ApiContentTranslationPublish.php
@@ -231,6 +231,10 @@
         * Notify user about milestones.
         */
        public function notifyTranslator() {
+               // Make sure Echo is installed.
+               if ( !class_exists( 'EchoEvent' ) ) {
+                       return;
+               }
                $user = $this->getUser();
                $translator = new ContentTranslation\Translator( $user );
                $translationCount = $translator->getTranslationsCount();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I96d2a0dce72970dfe33e5f6832d1e27b52da6f20
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

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

Reply via email to