Santhosh has uploaded a new change for review.

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

Change subject: fetchLinkData of CXLink class must return jQuery.Promise
......................................................................

fetchLinkData of CXLink class must return jQuery.Promise

An early return when title is null was causing js error

Testplan:
Translate the article La Gioconda (còpia del Museu del Prado)
from ca to en.
Click on first paragraph, you will see placeholder filled
with initial translation. Second paragraph onwards nothing
happens and a js error appears in console:
Uncaught TypeError: Cannot read property 'then' of undefined
With this patch, the js error should go away and placeholders
should work as expected.

Bug: T105687
Change-Id: I7565a3e2c9ee1bc5870314465e3f5b478e8addfa
---
M modules/tools/ext.cx.tools.link.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/tools/ext.cx.tools.link.js 
b/modules/tools/ext.cx.tools.link.js
index b3ad055..8629bfd 100644
--- a/modules/tools/ext.cx.tools.link.js
+++ b/modules/tools/ext.cx.tools.link.js
@@ -320,7 +320,7 @@
 
                title = this.getTitle();
                if ( !title ) {
-                       return;
+                       return $.Deferred().reject().promise();
                }
 
                api = this.siteMapper.getApi( language );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7565a3e2c9ee1bc5870314465e3f5b478e8addfa
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